Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrShouldDrop = errors.New("unprocessed message")
ErrShouldDrop 如果接收到的消息 consumer 无法处理,希望从队列中删除, 需要返回这个错误
Functions ¶
This section is empty.
Types ¶
type Consumer ¶
type Consumer struct {
// contains filtered or unexported fields
}
MQConsumer mq consumer 对象
type ConsumerWorker ¶
ConsumerWorker 处理从 MQ 得到的消息
type ExchangeKind ¶
type ExchangeKind string
const ( ExchangeTopic ExchangeKind = "topic" ExchangeTFanout ExchangeKind = "fanout" ExchangeTDirect ExchangeKind = "direct" ExchangeTHeaders ExchangeKind = "headers" )
type RabbitMqConsumer ¶
type RabbitMqConsumer interface {
Start()
Stop()
}
func NewConsumer ¶
func NewConsumer(ctx context.Context, worker ConsumerWorker, config *Config) RabbitMqConsumer
NewConsumer 创建一个 MQConsumer 实例
type RabbitMqProducer ¶
type RabbitMqProducer interface {
Destroy()
Publish(interface{}) error
}
func NewMqProducer ¶
func NewMqProducer(config *Config) RabbitMqProducer
Click to show internal directories.
Click to hide internal directories.