Documentation
¶
Index ¶
Constants ¶
View Source
const (
PriorityProperty = "x-max-priority" // deprecated, use QueueArgs
)
Variables ¶
View Source
var ( ErrBinderIsClosed = errors.New("binder is closed") ErrUnableToCloseConnection = errors.New("unable to close connection") ErrUnableToDeclareExchange = errors.New("unable to declare exchange") ErrUnableToDeclareQueue = errors.New("unable to declare queue") ErrUnableToBindQueueToExchange = errors.New("unable to bind queue to exchange") )
View Source
var ( ErrConfigIsRequired = errors.New("config is required") ErrConfigNotFound = errors.New("config is not found") )
View Source
var ( ErrMessageIsNil = errors.New("message is nil") ErrProducerClosed = errors.New("producer is closed") ErrClosingProducer = errors.New("error while closing producer") ErrUnableToBind = errors.New("unable to perform binding") ErrUnableToCreateChannel = errors.New("unable to get channel in connection to RabbitMQ") ErrUnableToCreateConnection = errors.New("unable to connect to RabbitMQ") )
View Source
var (
ErrAddressIsRequired = errors.New("address is mandatory")
)
Functions ¶
This section is empty.
Types ¶
type BindConfig ¶
type BindConfig struct {
Exchange string // required
RoutingKey string // required
Queue string // required
// optional
ExchangeKind Kind
ExchangeDurable bool
ExchangeAutoDelete bool
ExchangeInternal bool
ExchangeNoWait bool
ExchangeArgs map[string]interface{}
QueueDurable bool
QueueAutoDelete bool
QueueExclusive bool
QueueNoWait bool
QueueArgs map[string]interface{}
BindNoWait bool
BindArgs map[string]interface{}
}
type Binder ¶ added in v1.7.1
type Binder struct {
// contains filtered or unexported fields
}
func NewBinder ¶
func NewBinder(config *ConnectionConfig) (*Binder, error)
func (*Binder) Bind ¶ added in v1.7.1
func (b *Binder) Bind(config *BindConfig) error
type ConnectionConfig ¶
type ConnectionConfig struct {
Address string `mapstructure:"address"`
Username string `mapstructure:"username"`
Password string `mapstructure:"password"`
Vhost string `mapstructure:"vhost"`
}
func (*ConnectionConfig) Validate ¶
func (c *ConnectionConfig) Validate() error
type ConnectionsConfig ¶
type ConnectionsConfig map[string]*ConnectionConfig
func (*ConnectionsConfig) Validate ¶
func (c *ConnectionsConfig) Validate() error
type ConsumerConfig ¶
type ConsumerMetrics ¶ added in v1.6.6
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
Container is a simple container for holding named rabbit connections.
func NewContainer ¶
func NewContainer() *Container
func (*Container) AddConnection ¶
func (cont *Container) AddConnection(name string, cfg *ConnectionConfig) error
AddConnection adds a named connection to a container. It's possible to create consumer or producer on created connection later using CreateProducer ot CreateConsumer.
func (*Container) CreateConsumer ¶
func (cont *Container) CreateConsumer(consumerCfg *ConsumerConfig) (*Consumer, error)
CreateConsumer creates a new rabbit consumer by a connection name and subscribes it to a given queue
func (*Container) CreateProducer ¶
func (cont *Container) CreateProducer(producerCfg *ProducerConfig) (*Producer, error)
type Kind ¶
type Kind string
const KindDirect Kind = "direct"
const KindFanOut Kind = "fanout"
const KindHeaders Kind = "headers"
const KindTopic Kind = "topic"
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
func (*Message) IsRedelivered ¶
type ProducerConfig ¶
type ProducerConfig struct {
ConnectionName string
Tag string // optional
Bindings []*BindConfig
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.