Documentation
¶
Index ¶
- type RmqClient
- func (client *RmqClient) Close() error
- func (client *RmqClient) Connect() error
- func (client *RmqClient) ConnectionIsOpen() bool
- func (client *RmqClient) Consume(conf common.ConsumerConf, callback consumer.DeliveryCallback) (cancel func(noWait bool), err error)
- func (client *RmqClient) CreateConsumer(conf common.ConsumerConf, callback consumer.DeliveryCallback) *consumer.Consumer
- func (client *RmqClient) ExchangeDeclare(name, kind string, durable, autoDelete, internal, noWait, passive bool, ...) error
- func (client *RmqClient) ExchangeDelete(name string, ifUnused, noWait bool) error
- func (client *RmqClient) Get(queue string, autoAck bool) (amqp.Delivery, bool, error)
- func (client *RmqClient) IsReady() bool
- func (client *RmqClient) PublishBinary(ctx context.Context, exchange, key string, mandatory, immediate bool, ...) error
- func (client *RmqClient) PublishJson(ctx context.Context, exchange, key string, mandatory, immediate bool, obj any) error
- func (client *RmqClient) PublishText(ctx context.Context, exchange, key string, mandatory, immediate bool, ...) error
- func (client *RmqClient) QueueBind(name, key, exchange string, noWait bool, args amqp.Table) error
- func (client *RmqClient) QueueDeclare(name string, durable, autoDelete, exclusive, noWait bool, passive bool, ...) error
- func (client *RmqClient) QueueDelete(name string, ifUnused, ifEmpty, noWait bool) error
- func (client *RmqClient) QueueUnbind(name, key, exchange string, args amqp.Table) error
- func (client *RmqClient) RemoveConsumer(consumer *consumer.Consumer) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RmqClient ¶
type RmqClient struct {
// contains filtered or unexported fields
}
RmqClient Rabbitmq client opens and maintains the connection automatically restores it in case disconnection
func (*RmqClient) ConnectionIsOpen ¶
ConnectionIsOpen Return true if connection is open in current time
func (*RmqClient) Consume ¶ added in v1.0.0
func (client *RmqClient) Consume(conf common.ConsumerConf, callback consumer.DeliveryCallback) (cancel func(noWait bool), err error)
func (*RmqClient) CreateConsumer ¶
func (client *RmqClient) CreateConsumer(conf common.ConsumerConf, callback consumer.DeliveryCallback) *consumer.Consumer
CreateConsumer Create new consumer
func (*RmqClient) ExchangeDeclare ¶
func (client *RmqClient) ExchangeDeclare(name, kind string, durable, autoDelete, internal, noWait, passive bool, args amqp.Table) error
ExchangeDeclare declare new exchange
func (*RmqClient) ExchangeDelete ¶
ExchangeDelete delete exchange
func (*RmqClient) PublishBinary ¶
func (client *RmqClient) PublishBinary(ctx context.Context, exchange, key string, mandatory, immediate bool, data []byte) error
PublishBinary publish binary message
func (*RmqClient) PublishJson ¶
func (client *RmqClient) PublishJson(ctx context.Context, exchange, key string, mandatory, immediate bool, obj any) error
PublishJson publish json object
func (*RmqClient) PublishText ¶
func (client *RmqClient) PublishText(ctx context.Context, exchange, key string, mandatory, immediate bool, text string) error
PublishText publish string message
func (*RmqClient) QueueDeclare ¶
func (client *RmqClient) QueueDeclare(name string, durable, autoDelete, exclusive, noWait bool, passive bool, args amqp.Table) error
QueueDeclare declare new queue
func (*RmqClient) QueueDelete ¶
QueueDelete delete queue
func (*RmqClient) QueueUnbind ¶
QueueUnbind Unbind queue from exchange
Click to show internal directories.
Click to hide internal directories.