| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- package mqreq
-
- import (
- "time"
- )
-
- // ExchangeRequest 创建交换机的请求
- type ExchangeRequest struct {
- ChannelName string `json:"channel_name"`
- ExchangeName string `json:"exchange_name"`
- ExchangeType string `json:"exchange_type"` // direct, fanout, topic, headers
- Durable bool `json:"durable"`
- Internal bool `json:"internal"`
- AutoDelete bool `json:"auto_delete"`
- NoWait bool `json:"no_wait"`
- Arguments map[string]string `json:"arguments"`
- }
-
- // QueueRequest 创建队列的请求
- type QueueRequest struct {
- ChannelName string `json:"channel_name"`
- QueueName string `json:"queue_name"`
- Durable bool `json:"durable"`
- Exclusive bool `json:"exclusive"`
- AutoDelete bool `json:"auto_delete"`
- NoWait bool `json:"no_wait"`
- Url string `json:"url"`
- Concurrency int `json:"Concurrency"`
- ExchangeName string `json:"exchange_name"`
- RoutingKey string `json:"routing_key"`
-
- Arguments map[string]string `json:"arguments"`
- }
-
- // BindRequest 绑定队列的请求
- type QueueBindRequest struct {
- ChannelName string `json:"channel_name"`
- QueueName string `json:"queue_name"`
- ExchangeName string `json:"exchange_name"`
- RoutingKey string `json:"routing_key"`
- NoWait bool `json:"no_wait"`
- Arguments map[string]string `json:"arguments"`
- }
-
- // MessageRequest 发送消息的请求
- type MessageRequest struct {
- ChannelName string `json:"channel_name"`
- ExchangeName string `json:"exchange_name"`
- RoutingKey string `json:"routing_key"`
- Message interface{} `json:"message"`
- ContentType string `json:"content_type"`
- Headers map[string]interface{} `json:"headers"`
- Priority uint8 `json:"priority"`
- CorrelationID string `json:"correlation_id"`
- ReplyTo string `json:"reply_to"`
- Expiration string `json:"expiration"`
- MessageID string `json:"message_id"`
- Timestamp time.Time `json:"timestamp"`
- Type string `json:"type"`
- AppID string `json:"app_id"`
- }
-
- // BytesMessageRequest 发送字节消息的请求
- type BytesMessageRequest struct {
- ChannelName string `json:"channel_name"`
- ExchangeName string `json:"exchange_name"`
- RoutingKey string `json:"routing_key"`
- Data []byte `json:"data"`
- ContentType string `json:"content_type"`
- Headers map[string]string `json:"headers"`
- }
-
- // QueueInfoRequest 获取队列信息的请求
- type QueueInfoRequest struct {
- ChannelName string `json:"channel_name,omitempty"`
- QueueName string `json:"queue_name,omitempty"`
- }
|