Documentation ¶
Index ¶
- func ConnectRabbitMQ(conf AmqpConfig) (*amqp.Connection, error)
- type AmqpConfig
- type Config
- type DLX
- type MsgData
- type Option
- type PublishMQ
- type PublishManager
- func (self *PublishManager) Client(ds ...string) (*PublishManager, error)
- func (self *PublishManager) Connect() (*PublishManager, error)
- func (self *PublishManager) InitConfig(input ...AmqpConfig) (*PublishManager, error)
- func (self *PublishManager) Publish(exchange, queue string, dataType int64, content interface{}) error
- func (self *PublishManager) PublishMsgData(data *MsgData) error
- func (self *PublishManager) Queue(data *MsgData) (*QueueData, error)
- type PullManager
- type PullReceiver
- type QueueData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectRabbitMQ ¶
func ConnectRabbitMQ(conf AmqpConfig) (*amqp.Connection, error)
Types ¶
type AmqpConfig ¶
type Config ¶
type Config struct { Option Option Durable bool PrefetchCount int PrefetchSize int IsNack bool AutoAck bool }
Amqp监听配置参数
type PublishManager ¶
type PublishManager struct {
// contains filtered or unexported fields
}
func NewPublish ¶
func NewPublish(ds ...string) (*PublishManager, error)
func (*PublishManager) Client ¶
func (self *PublishManager) Client(ds ...string) (*PublishManager, error)
func (*PublishManager) Connect ¶
func (self *PublishManager) Connect() (*PublishManager, error)
func (*PublishManager) InitConfig ¶
func (self *PublishManager) InitConfig(input ...AmqpConfig) (*PublishManager, error)
func (*PublishManager) Publish ¶
func (self *PublishManager) Publish(exchange, queue string, dataType int64, content interface{}) error
func (*PublishManager) PublishMsgData ¶
func (self *PublishManager) PublishMsgData(data *MsgData) error
type PullManager ¶
type PullManager struct {
// contains filtered or unexported fields
}
func NewPull ¶
func NewPull(ds ...string) (*PullManager, error)
func (*PullManager) AddPullReceiver ¶
func (self *PullManager) AddPullReceiver(receivers ...*PullReceiver)
func (*PullManager) Client ¶
func (self *PullManager) Client(ds ...string) (*PullManager, error)
func (*PullManager) Connect ¶
func (self *PullManager) Connect() (*PullManager, error)
func (*PullManager) InitConfig ¶
func (self *PullManager) InitConfig(input ...AmqpConfig) (*PullManager, error)
type PullReceiver ¶
type PullReceiver struct { Config *Config ContentInter func(typ int64) interface{} Callback func(msg *MsgData) error Debug bool // 是否打印具体pull数据实体 Delay int // pull失败重试间隔 // contains filtered or unexported fields }
func (*PullReceiver) OnError ¶
func (self *PullReceiver) OnError(err error)
func (*PullReceiver) OnReceive ¶
func (self *PullReceiver) OnReceive(b []byte) bool
Click to show internal directories.
Click to hide internal directories.