Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetLogLevel ¶
SetLogLevel sets the rmqclient log level
noop if caller provides it's own zap logger
Types ¶
type ConsumeHandle ¶
ConsumeHandle consumer callback handle's signature
Handle should honor passing-in context for cleanup
type Publish ¶
type Publish struct {
// contains filtered or unexported fields
}
Publish is the publish interface for client https://godoc.org/github.com/streadway/amqp#Channel.Publish https://godoc.org/github.com/streadway/amqp#Channel.NotifyReturn https://godoc.org/github.com/streadway/amqp#Channel.NotifyPublish https://godoc.org/github.com/streadway/amqp#Channel.NotifyConfirm
type RmqConfig ¶
type RmqConfig struct { Username string `validate:"required"` Password string `validate:"required"` Host string `validate:"required"` Vhost string `validate:"required"` Port int `validate:"required"` ReconnectWait time.Duration `validate:"isdefault"` }
RmqConfig is the config type for rmqclient
type RmqStruct ¶
type RmqStruct struct {
// contains filtered or unexported fields
}
RmqStruct is the instance of rabbitmq service
func (*RmqStruct) GetPublish ¶
GetPublish retrieve publish from pool
func (*RmqStruct) RegisterHandle ¶
func (rmq *RmqStruct) RegisterHandle( name string, h ConsumeHandle, autoAck bool, exclusive bool, noWait bool, ) (err error)
RegisterHandle register consumer's handle
func (*RmqStruct) Run ¶
func (rmq *RmqStruct) Run()
Run starts rabbitmq service
Non-block call ¶
Runs as daemon, exit on caller's context cancel()
func (*RmqStruct) UnregisterHandle ¶
UnregisterHandle unregister consumer's handle