amqp

package
v0.4.13 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPublisher

func NewPublisher(uri, queueName string, logger logr.Logger) (*publisher, error)

NewPublisher creates a new AMQP publisher that targets a specific broker uri and queue.

Types

type Channel

type Channel interface {
	QueueDeclare(name string, durable bool, autoDelete bool, exclusive bool, noWait bool, args amqp.Table) (amqp.Queue, error)
	Publish(exchange string, key string, mandatory bool, immediate bool, msg amqp.Publishing) error
}

Channel defines the AMQP channel operations required by this library.

type Connection

type Connection interface {
	io.Closer

	Channel() (Channel, error)
	NotifyClose(receiver chan *amqp.Error) chan *amqp.Error
}

Connection defines the AMQP connections operations required by this library.

type ConnectionAdapter

type ConnectionAdapter struct {
	*amqp.Connection
}

ConnectionAdapter adapts the amqp.Connection type so that it adheres to our libraries interfaces.

func (ConnectionAdapter) Channel

func (c ConnectionAdapter) Channel() (Channel, error)

Channel adapts an amqp.Channel to our Channel interface.

type DialerAdapter

type DialerAdapter func(url string) (Connection, error)

DialerAdapter is a function that returns a handle to a Connection type.

Jump to

Keyboard shortcuts

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