Documentation ¶
Index ¶
- type Channel
- type Config
- type Connection
- type MQ
- func (mq *MQ) Check(_ context.Context) error
- func (mq *MQ) Dial() error
- func (mq *MQ) Init(ctx context.Context, log logger.Logger) error
- func (mq *MQ) Publish(ctx context.Context, target string, routingKey, payload []byte) error
- func (mq *MQ) Subscribe(ctx context.Context, target string, message query.Response) error
- func (mq *MQ) UnSubscribe(target string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Channel ¶
Channel amqp.Channel wapper
type Connection ¶
type Connection struct { *amqp.Connection // contains filtered or unexported fields }
Connection amqp.Connection wrapper
func (*Connection) Channel ¶
func (c *Connection) Channel() (*Channel, error)
Channel wraps amqp.Connection.Channel to provide an auto-reconnecting channel.
type MQ ¶
type MQ struct {
// contains filtered or unexported fields
}
func (*MQ) Dial ¶
Dial wraps amqp.Dial to establish a connection and set up automatic reconnection in case the connection is lost.
func (*MQ) Init ¶
Init initializes the RabbitMQ connection and sets up the channel. It also sets up a graceful shutdown mechanism to close the connection and channel when the context is done.
func (*MQ) UnSubscribe ¶
Click to show internal directories.
Click to hide internal directories.