Documentation
¶
Index ¶
- type AMQPBroker
- func (b *AMQPBroker) BindQueue(queue, exchange, routingKey string) error
- func (b *AMQPBroker) Channel() (*amqp.Channel, error)
- func (b *AMQPBroker) Close() error
- func (b *AMQPBroker) Connect(ctx context.Context) error
- func (b *AMQPBroker) Consume(queue string, autoAck bool) (<-chan amqp.Delivery, error)
- func (b *AMQPBroker) DeclareExchange(name string, kind string) error
- func (b *AMQPBroker) DeclareQueue(name string) (amqp.Queue, error)
- func (b *AMQPBroker) Disconnect() error
- func (b *AMQPBroker) IsConnected() bool
- func (b *AMQPBroker) Publish(exchange, routingKey string, msg amqp.Publishing) error
- type Broker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AMQPBroker ¶
type AMQPBroker struct {
// contains filtered or unexported fields
}
func NewAMQPBroker ¶
func NewAMQPBroker(cfg *config.RabbitMQConfig) *AMQPBroker
func (*AMQPBroker) BindQueue ¶
func (b *AMQPBroker) BindQueue(queue, exchange, routingKey string) error
func (*AMQPBroker) Close ¶
func (b *AMQPBroker) Close() error
func (*AMQPBroker) DeclareExchange ¶
func (b *AMQPBroker) DeclareExchange(name string, kind string) error
func (*AMQPBroker) DeclareQueue ¶
func (b *AMQPBroker) DeclareQueue(name string) (amqp.Queue, error)
func (*AMQPBroker) Disconnect ¶
func (b *AMQPBroker) Disconnect() error
func (*AMQPBroker) IsConnected ¶
func (b *AMQPBroker) IsConnected() bool
func (*AMQPBroker) Publish ¶
func (b *AMQPBroker) Publish(exchange, routingKey string, msg amqp.Publishing) error
type Broker ¶
type Broker interface { // Connect connects to the message queue Connect(ctx context.Context) error // Close closes the connection Close() error // Publish publishes a message Publish(exchange, routingKey string, msg amqp.Publishing) error // Consume consumes messages from a queue Consume(queue string, autoAck bool) (<-chan amqp.Delivery, error) // DeclareExchange declares an exchange DeclareExchange(name string, kind string) error // DeclareQueue declares a queue DeclareQueue(name string) (amqp.Queue, error) // BindQueue binds a queue to an exchange BindQueue(queue, exchange, routingKey string) error // IsConnected checks the connection status IsConnected() bool // Disconnect gracefully disconnects from the broker Disconnect() error Channel() (*amqp.Channel, error) }
Broker defines the interface for a message broker
Click to show internal directories.
Click to hide internal directories.