amqp

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotAcked = errors.New("message was not acked")

ErrNotAcked indicated that published messages was not acked by RabbitMQ

View Source
var ErrTimedout = errors.New("message was timed out")

Functions

func NewConnection

func NewConnection(url string) (*connection, error)

NewConnection returns an AMQP Connection. Uses a default ConnectionConfig with 2 second of reconnect interval.

func NewConnectionConfig

func NewConnectionConfig(url string, config ConnectionConfig) (*connection, error)

NewConnectionConfig returns an AMQP Connection.

func NewConsumer

func NewConsumer(c messaging.Connection, autoAck bool, exchange, queue string) (*consumer, error)

NewConsumer returns a new AMQP Consumer. Uses a default ConsumerConfig with 2 second of consume retry interval.

func NewConsumerConfig

func NewConsumerConfig(c messaging.Connection, autoAck bool, exchange, queue string, config ConsumerConfig) (*consumer, error)

NewConsumerConfig returns a new AMQP Consumer.

func NewProducer

func NewProducer(c messaging.Connection, exchange string) (*producer, error)

NewProducer returns a new AMQP Producer. Uses a default ProducerConfig with 2 second of publish interval.

func NewProducerConfig

func NewProducerConfig(c messaging.Connection, exchange string, config ProducerConfig) (*producer, error)

NewProducerConfig returns a new AMQP Producer.

func NewUUIDv4

func NewUUIDv4() (string, error)

Types

type ConnectionConfig

type ConnectionConfig struct {
	ReconnectInterval time.Duration
}

ConnectionConfig to be used when creating a new connection.

type ConsumerConfig

type ConsumerConfig struct {
	ConsumeRetryInterval time.Duration
	MaxRetryDelay        time.Duration
	PrefetchCount        int
	PrefixName           string
}

ConsumerConfig to be used when creating a new producer.

type ProducerConfig

type ProducerConfig struct {
	PublishInterval time.Duration
	ConfirmTimeout  time.Duration
}

ProducerConfig to be used when creating a new producer.

Jump to

Keyboard shortcuts

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