mrabbit

package module
v0.0.0-...-2e54c6a Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2021 License: MIT Imports: 2 Imported by: 0

README

mrabbit

mrabbit is package to interact with rabbit mq

Documentation

Index

Constants

View Source
const (
	MaxTrial1 = 3
	MaxTrial2 = 7
)

Variables

This section is empty.

Functions

This section is empty.

Types

type IRabbit

type IRabbit interface {
	DialRabbit(string, int) error
	CreateChannel() error
	CloseChannel() error
	CloseConnection() error
	SetHeartBeat(time.Duration)
	DeclareQueue(string, bool, bool, bool, bool, amqp.Table) (amqp.Queue, error)
	NotifyClose(chan *amqp.Error) chan *amqp.Error
	ChannelQos(prefetchCount, prefetchSize int, global bool) error
	ConsumeQueueMsq(queue, consumer string, autoAck, exclusive, noLocal,
		noWait bool, args amqp.Table) (<-chan amqp.Delivery, error)
	GetNotifyCloseChannel() chan *amqp.Error
	GetWaitingTimeToConnect(int) time.Duration
}

func CreateRealRabbitInstance

func CreateRealRabbitInstance() IRabbit

type NotifyListener

type NotifyListener struct {
	NotifyCloseCh chan *amqp.Error
}

func (*NotifyListener) GetNotifyCloseChannel

func (listener *NotifyListener) GetNotifyCloseChannel() chan *amqp.Error

type RealRabbit

type RealRabbit struct {
	NotifyListener
	// contains filtered or unexported fields
}

func (*RealRabbit) ChannelQos

func (q *RealRabbit) ChannelQos(prefetchCount, prefetchSize int, global bool) error

func (*RealRabbit) CloseChannel

func (q *RealRabbit) CloseChannel() error

func (*RealRabbit) CloseConnection

func (q *RealRabbit) CloseConnection() error

func (*RealRabbit) ConsumeQueueMsq

func (q *RealRabbit) ConsumeQueueMsq(queue, consumer string, autoAck, exclusive,
	noLocal, noWait bool, args amqp.Table) (<-chan amqp.Delivery, error)

func (*RealRabbit) CreateChannel

func (q *RealRabbit) CreateChannel() error

func (*RealRabbit) DeclareQueue

func (q *RealRabbit) DeclareQueue(queue string, durable, autodelete, exclusive, nowait bool, args amqp.Table) (amqp.Queue, error)

func (*RealRabbit) DialRabbit

func (q *RealRabbit) DialRabbit(uri string, commandNo int) error

func (*RealRabbit) GetWaitingTimeToConnect

func (q *RealRabbit) GetWaitingTimeToConnect(trial int) time.Duration

func (*RealRabbit) NotifyClose

func (q *RealRabbit) NotifyClose(ch chan *amqp.Error) chan *amqp.Error

func (*RealRabbit) SetHeartBeat

func (q *RealRabbit) SetHeartBeat(duration time.Duration)

Jump to

Keyboard shortcuts

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