Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeclareExchange ¶
DeclareExchange creates exchange to publish events
func DeclareQueue ¶
DeclareQueue decrares durable queue
Types ¶
type ChannelProvider ¶
type ChannelProvider struct {
// contains filtered or unexported fields
}
ChannelProvider provider amqp channel
func NewChannelProvider ¶
func NewChannelProvider() (*ChannelProvider, error)
NewChannelProvider initializes channel provider
func (*ChannelProvider) Channel ¶
func (pr *ChannelProvider) Channel() (*amqp.Channel, error)
Channel return cached channel or tries to connect to rabbit broker
func (*ChannelProvider) Healthy ¶
func (pr *ChannelProvider) Healthy() error
Healthy checks if rabbit channel is open
func (*ChannelProvider) QueueName ¶
func (pr *ChannelProvider) QueueName(name string) string
QueueName return queue name for channel, may append prefix
func (*ChannelProvider) RunOnChannelWithRetry ¶
func (pr *ChannelProvider) RunOnChannelWithRetry(f runOnChannelFunc) error
RunOnChannelWithRetry invokes method on channel with retry
type Publisher ¶
type Publisher struct {
ChannelProvider *ChannelProvider
}
Publisher publish events to rabbit mq broker
func NewPublisher ¶
func NewPublisher(provider *ChannelProvider) *Publisher
NewPublisher initializes rabbit publisher
type Sender ¶
type Sender struct {
ChannelProvider *ChannelProvider
}
Sender performs messages sending using rabbit mq broker
func NewSender ¶
func NewSender(provider *ChannelProvider) *Sender
NewSender initializes rabbit sender
Click to show internal directories.
Click to hide internal directories.