rabbitmq

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const MAX_ATTEMPTS = 3

Variables

This section is empty.

Functions

func GenerateQueueName added in v1.0.0

func GenerateQueueName(ex string, topic string) string

Types

type Broker added in v1.0.0

type Broker struct{}

func (*Broker) Dial added in v1.0.0

func (b *Broker) Dial(url string) (RBConnection, error)

func (*Broker) DialTLS added in v1.0.0

func (b *Broker) DialTLS(url string, conf *tls.Config) (RBConnection, error)

type ChannelConsumer added in v1.0.0

type ChannelConsumer interface {
	Consume(queue string, consumer string, autoAck bool, exclusive bool, noLocal bool, noWait bool, args amqp.Table) (<-chan amqp.Delivery, error)
	NotifyClose(c chan *amqp.Error) chan *amqp.Error
	Close() error
}

type ChannelCreator added in v1.0.0

type ChannelCreator interface {
	Channel() (RabbitChannel, error)
}

type ConnectionManager added in v1.0.0

type ConnectionManager struct {
	// contains filtered or unexported fields
}

func (*ConnectionManager) Channel added in v1.0.0

func (m *ConnectionManager) Channel() (RabbitChannel, error)

func (*ConnectionManager) Connect added in v1.0.0

func (m *ConnectionManager) Connect(connectionUrl string) (<-chan *amqp.Error, error)

func (*ConnectionManager) Disconnect added in v1.0.0

func (m *ConnectionManager) Disconnect()

type Connector added in v1.0.0

type Connector interface {
	Connect(connectionUrl string) (<-chan *amqp.Error, error)
	Disconnect()
}

type Exchange added in v1.0.0

type Exchange struct {
	// contains filtered or unexported fields
}

func (*Exchange) Start added in v1.0.0

func (e *Exchange) Start() error

func (*Exchange) StartConsuming added in v1.0.0

func (e *Exchange) StartConsuming(topic string, deliveries <-chan amqp.Delivery)

func (*Exchange) Stop added in v1.0.0

func (e *Exchange) Stop()

type ExchangeFactory added in v1.0.0

type ExchangeFactory struct {
	// contains filtered or unexported fields
}

func (*ExchangeFactory) Build added in v1.0.0

func (f *ExchangeFactory) Build() (ExchangeOrganizer, error)

func (*ExchangeFactory) WithChanCreator added in v1.0.0

func (f *ExchangeFactory) WithChanCreator(creator ChannelCreator) Factory

func (*ExchangeFactory) WithExchange added in v1.0.0

func (f *ExchangeFactory) WithExchange(ex *types.Exchange) Factory

func (*ExchangeFactory) WithInvoker added in v1.0.0

func (f *ExchangeFactory) WithInvoker(client types.Invoker) Factory

type ExchangeHandler added in v1.0.0

type ExchangeHandler interface {
	ExchangeDeclare(name, kind string, durable, autoDelete, internal, noWait bool, args amqp.Table) error
}

type ExchangeOrganizer added in v1.0.0

type ExchangeOrganizer interface {
	Starter
	Stopper
}

func NewExchange added in v1.0.0

func NewExchange(channel ChannelConsumer, client types.Invoker, definition *types.Exchange) ExchangeOrganizer

type Factory added in v1.0.0

type Factory interface {
	WithInvoker(client types.Invoker) Factory
	WithChanCreator(creator ChannelCreator) Factory
	WithExchange(ex *types.Exchange) Factory
	Build() (ExchangeOrganizer, error)
}

func NewFactory added in v1.0.0

func NewFactory() Factory

type Manager added in v1.0.0

type Manager interface {
	Connector
	ChannelCreator
}

func NewConnectionManager added in v1.0.0

func NewConnectionManager(dialer RBDialer) Manager

type QueueHandler added in v1.0.0

type QueueHandler interface {
	QueueDeclare(name string, durable, autoDelete, exclusive, noWait bool, args amqp.Table) (amqp.Queue, error)
	QueueBind(name, key, exchange string, noWait bool, args amqp.Table) error
}

type RBConnection added in v1.0.0

type RBConnection interface {
	NotifyClose(receiver chan *amqp.Error) chan *amqp.Error
	Close() error
	Channel() (*amqp.Channel, error)
}

type RBDialer added in v1.0.0

type RBDialer interface {
	Dial(url string) (RBConnection, error)
	DialTLS(url string, conf *tls.Config) (RBConnection, error)
}

func NewBroker added in v1.0.0

func NewBroker() RBDialer

type RabbitChannel added in v1.0.0

type RabbitChannel interface {
	ExchangeHandler
	QueueHandler
	ChannelConsumer
}

type Starter added in v1.0.0

type Starter interface {
	Start() error
}

type Stopper added in v1.0.0

type Stopper interface {
	Stop()
}

Jump to

Keyboard shortcuts

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