Нет описания
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. package types
  2. import (
  3. "time"
  4. )
  5. // ExchangeRequest 创建交换机的请求
  6. type ExchangeRequest struct {
  7. ChannelName string `json:"channel_name"`
  8. ExchangeName string `json:"exchange_name"`
  9. ExchangeType string `json:"exchange_type"` // direct, fanout, topic, headers
  10. Durable bool `json:"durable"`
  11. Internal bool `json:"internal"`
  12. AutoDelete bool `json:"auto_delete"`
  13. NoWait bool `json:"no_wait"`
  14. Arguments map[string]string `json:"arguments"`
  15. }
  16. // QueueRequest 创建队列的请求
  17. type QueueRequest struct {
  18. ChannelName string `json:"channel_name"`
  19. QueueName string `json:"queue_name"`
  20. Durable bool `json:"durable"`
  21. Exclusive bool `json:"exclusive"`
  22. AutoDelete bool `json:"auto_delete"`
  23. NoWait bool `json:"no_wait"`
  24. Arguments map[string]string `json:"arguments"`
  25. }
  26. // BindRequest 绑定队列的请求
  27. type BindRequest struct {
  28. ChannelName string `json:"channel_name"`
  29. QueueName string `json:"queue_name"`
  30. ExchangeName string `json:"exchange_name"`
  31. RoutingKey string `json:"routing_key"`
  32. NoWait bool `json:"no_wait"`
  33. Arguments map[string]string `json:"arguments"`
  34. }
  35. // MessageRequest 发送消息的请求
  36. type MessageRequest struct {
  37. ChannelName string `json:"channel_name"`
  38. ExchangeName string `json:"exchange_name"`
  39. RoutingKey string `json:"routing_key"`
  40. Message interface{} `json:"message"`
  41. ContentType string `json:"content_type"`
  42. Headers map[string]interface{} `json:"headers"`
  43. Priority uint8 `json:"priority"`
  44. CorrelationID string `json:"correlation_id"`
  45. ReplyTo string `json:"reply_to"`
  46. Expiration string `json:"expiration"`
  47. MessageID string `json:"message_id"`
  48. Timestamp time.Time `json:"timestamp"`
  49. Type string `json:"type"`
  50. AppID string `json:"app_id"`
  51. }
  52. // BytesMessageRequest 发送字节消息的请求
  53. type BytesMessageRequest struct {
  54. ChannelName string `json:"channel_name"`
  55. ExchangeName string `json:"exchange_name"`
  56. RoutingKey string `json:"routing_key"`
  57. Data []byte `json:"data"`
  58. ContentType string `json:"content_type"`
  59. Headers map[string]string `json:"headers"`
  60. }
  61. // QueueInfoRequest 获取队列信息的请求
  62. type QueueInfoRequest struct {
  63. ChannelName string `json:"channel_name"`
  64. QueueName string `json:"queue_name"`
  65. }
  66. // RabbitMQResult RabbitMQ操作结果
  67. // type RabbitMQResult struct {
  68. // Success bool `json:"success"`
  69. // Error string `json:"error,omitempty"`
  70. // Data interface{} `json:"data,omitempty"`
  71. // Message string `json:"message,omitempty"`
  72. // Time string `json:"time"`
  73. // Exchange string `json:"exchange,omitempty"`
  74. // Queue string `json:"queue,omitempty"`
  75. // MessageID string `json:"message_id,omitempty"`
  76. // QueueInfo interface{} `json:"queue_info,omitempty"`
  77. // }
  78. // QueryRequest 查询请求
  79. type QueryRequest struct {
  80. SQL string `json:"sql" binding:"required"`
  81. Params map[string]interface{} `json:"params,omitempty"` //名称参数
  82. PositionalParams []interface{} `json:"positionalParams,omitempty"` // 位置参数
  83. WriterHeader bool `json:"writerHeader,omitempty"` //如果查询返回cvs格式时候,包含表头还是不包含。true包含。第一行是表头
  84. AgentUrl string `json:"agentUrl,omitempty"` //远程服务器地址
  85. AgentToken string `json:"agentToken,omitempty"` //远程代理服务器token
  86. DorisDatabase string `json:"dorisDatabase,omitempty"` //doris数据库名称
  87. DorisTable string `json:"dorisTable,omitempty"` //doris数据库里的表名称
  88. }
  89. // QueryResult 查询结果
  90. type QueryResult struct {
  91. Success bool `json:"success"`
  92. Data interface{} `json:"data,omitempty"`
  93. Error string `json:"error,omitempty"`
  94. Count int `json:"count,omitempty"`
  95. Time string `json:"time,omitempty"`
  96. QueryTime time.Duration `json:"queryTime,omitempty"`
  97. SaveTime time.Duration `json:"saveTime,omitempty"`
  98. TotalCount int `json:"totalCount,omitempty"`
  99. Message string `json:"message,omitempty"`
  100. }
  101. // PageResult 分页结果
  102. type PageResult struct {
  103. QueryResult
  104. Page int `json:"page"`
  105. PageSize int `json:"pageSize"`
  106. Total int `json:"total"`
  107. }
  108. // HealthCheck 健康检查
  109. type HealthCheck struct {
  110. Status string `json:"status"`
  111. Timestamp time.Time `json:"timestamp"`
  112. Version string `json:"version"`
  113. }