Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Configures the AMQP delivery to deliver notifications directly to // the configured Exchange. // // If true "Callback" is ignored. // If false a notifier.Callback is delivered to the queue and clients // utilize the pagination API to retrieve. Direct bool // Specifies the number of notifications delivered in single AMQP message // when Direct is true. // // Ignored if Direct is not true // If 0 or 1 is provided no rollup occurs and each notification is delivered // separately. Rollup int // The AMQP exchange notifications will be delivered to. // A passive declare is performed and if the exchange does not exist // the declare will fail. Exchange Exchange `yaml:"exchange"` // The routing key used to route notifications to the desired queue. RoutingKey string `yaml:"routing_key"` // The callback url where notifications are retrieved. Callback string // A list of AMQP compliant URI scheme. see: https://www.rabbitmq.com/uri-spec.html // example: "amqp://user:pass@host:10000/vhost" // // The first successful connection will be used by the amqp deliverer. // // If "amqps://" broker URI schemas are provided the TLS configuration below is required. URIs []string `yaml:"uris"` TLS *TLS `yaml:"tls"` // contains filtered or unexported fields }
Config provides configuration for an AMQP deliverer.
type Deliverer ¶
type Deliverer struct {
// contains filtered or unexported fields
}
Deliverer is an AMQP deliverer which publishes a notifier.Callback to the the broker.
It's an error to configure this deliverer with an Exchange that does not exist. Administrators should configure the Exchange, Queue, and Bindings before starting this deliverer.
type DirectDeliverer ¶
type DirectDeliverer struct {
// contains filtered or unexported fields
}
DirectDeliverer is an AMQP deliverer which publishes notifications directly to the broker.
It's an error to configure this deliverer with an exchange that does not exist. Administrators should configure the Exchange, Queue, and Bindings before starting this deliverer.
func NewDirectDeliverer ¶
func NewDirectDeliverer(conf Config) (*DirectDeliverer, error)
func (*DirectDeliverer) Name ¶
func (d *DirectDeliverer) Name() string
func (*DirectDeliverer) Notifications ¶
func (d *DirectDeliverer) Notifications(ctx context.Context, n []notifier.Notification) error
Notifications will copy the provided notifications into a buffer for AMQP delivery.
type Exchange ¶
type Exchange struct { // The name of the exchange Name string `yaml:"name"` // The type of the exchange. Typically: // "direct" // "fanout" // "topic" // "headers" Type string `yaml:"type"` // Whether the exchange survives server restarts Durable bool `yaml:"durability"` // Whether bound consumers define the lifecycle of the Exchange. AutoDelete bool `yaml:"auto_delete"` }
Exchange are the required fields necessary to check the existence of an Exchange
For more details see: https://godoc.org/github.com/streadway/amqp#Channel.ExchangeDeclarePassive