Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { // QueueName the name of the queue to connect to QueueName string // Queue is the configuration for the queue Queue Queue // Consume is the configuration of the consumer Consume Consume // Publish is the configuration for the publishing of messages Publish Publish // Endpoint is the configuration for the connection endpoint Endpoint Endpoint // Exchange is the configuration for the exchange, if it is created Exchange Exchange }
Config is the configuration for AMQP
func (Config) SetExchangeName ¶ added in v1.3.0
type Consume ¶
type Consume struct { // Consumer is the name of the consumer Consumer string `mapstructure:"consumer"` // AutoAck causes the server to acknowledge deliveries to this consumer prior to writing the delivery to the network AutoAck bool // Exclusive: when true, the server will ensure that this is the sole consumer from this queue // This should always be false. Exclusive bool // NoLocal is not supported by RabbitMQ NoLocal bool // NoWait: do not wait for the server to confirm the request and immediately begin deliveries NoWait bool `mapstructure:"consumerNoWait"` // Args contains addition arguments to be provided Args amqp.Table }
Consume is the configuration of the consumer of messages from the queue
type Endpoint ¶
type Endpoint struct { QueueProtocol string `mapstructure:"queueProtocol"` QueueUser string `mapstructure:"queueUser"` QueuePassword string `mapstructure:"queuePassword"` QueueHost string `mapstructure:"queueHost"` QueuePort int `mapstructure:"queuePort"` QueueVHost string `mapstructure:"queueVHost"` }
Endpoint is the configuration needed to connect to a rabbitmq vhost
type Exchange ¶
type Exchange struct { Name string `mapstructure:"exchangeName"` Kind string `mapstructure:"exchangeKind"` Durable bool `mapstructure:"exchangeDurable"` // AutoDelete tells the queue to drop messages if there are not any consumers AutoDelete bool `mapstructure:"exchangeAutoDelete"` // Exclusive queues are only accessible by the connection that declares them Internal bool `mapstructure:"exchangeInternal"` // NoWait is true, the queue will assume to be declared on the server NoWait bool `mapstructure:"exchangeNoWait"` Args amqp.Table }
Exchange is the configuration for the exchange to be created/used
func NewExchange ¶
NewExchange gets Exchange from the values in viper
type Publish ¶
type Publish struct { Mandatory bool `mapstructure:"publishMandatory"` Immediate bool `mapstructure:"publishImmediate"` Exchange string `mapstructure:"exchangeName"` }
Publish is the configuration for the publishing of messages
type Queue ¶
type Queue struct { // Durable sets the queue to be persistent Durable bool `mapstructure:"queueDurable"` // AutoDelete tells the queue to drop messages if there are not any consumers AutoDelete bool `mapstructure:"queueAutoDelete"` // Exclusive queues are only accessible by the connection that declares them Exclusive bool // NoWait is true, the queue will assume to be declared on the server NoWait bool // Args contains addition arguments to be provided Args amqp.Table // ReConnRetries is the number of times to attempt to re-connect to a queue // if a connection error is found ReconnRetries int `mapstructure:"queueReconnRetries` // Retries is the number of times to retry an action before giving up Retries int `mapstructure:"queueRetries"` // RetryDelay is the delay between retries RetryDelay time.Duration `mapstructure:"queueRetryDelay"` }
Queue is the configuration of the queue to be created if the queue does not yet exist
Click to show internal directories.
Click to hide internal directories.