rabbit

package
v0.0.0-...-36d8597 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel struct {
	*amqp.Channel
	// contains filtered or unexported fields
}

Channel amqp.Channel wapper

func (*Channel) Close

func (ch *Channel) Close() error

Close ensure closed flag set

func (*Channel) Consume

func (ch *Channel) Consume(queue, consumer string, autoAck, exclusive, noLocal, noWait bool, args amqp.Table) (<-chan amqp.Delivery, error)

Consume wrap amqp.Channel.Consume, the returned delivery will end only when channel closed by developer

func (*Channel) IsClosed

func (ch *Channel) IsClosed() bool

IsClosed indicate closed by developer

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 wrap amqp.Connection.Channel, get a auto reconnect channel

type RabbitMQ

type RabbitMQ struct {
	URI string
	// contains filtered or unexported fields
}

func New

func New(log logger.Logger) *RabbitMQ

func (*RabbitMQ) Close

func (mq *RabbitMQ) Close() error

func (*RabbitMQ) Dial

func (mq *RabbitMQ) Dial() error

Dial wrap amqp.Dial, dial and get a reconnect connection

func (*RabbitMQ) Init

func (mq *RabbitMQ) Init(_ context.Context) error

func (*RabbitMQ) Publish

func (mq *RabbitMQ) Publish(ctx context.Context, target string, message query.Message) error

func (*RabbitMQ) Subscribe

func (mq *RabbitMQ) Subscribe(target string, message query.Response) error

func (*RabbitMQ) UnSubscribe

func (mq *RabbitMQ) UnSubscribe(target string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL