Documentation
¶
Index ¶
- type ConsumeOpt
- type ExchangeOpt
- type QueueOpt
- type Receiver
- type Sender
- type Subscriber
- func (s *Subscriber) AddQueueArg(key string, value interface{}) *Subscriber
- func (s *Subscriber) Process(h func([]byte) error) error
- func (s *Subscriber) SetAmqpConfig(config amqp.Config) *Subscriber
- func (s *Subscriber) SetExchange(ex string) *Subscriber
- func (s *Subscriber) SetPassiveMode(mode bool) *Subscriber
- func (s *Subscriber) SetPrefetchCount(n int) *Subscriber
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsumeOpt ¶
type ConsumeOpt struct {
Consumer string
AutoAck bool
Exclusive bool
NoLocal bool
NoWait bool
Args map[string]interface{}
}
ConsumeOpt contains options for the consumer.
type ExchangeOpt ¶
type ExchangeOpt struct {
Kind string
Durable bool
Autodelete bool
Internal bool
NoWait bool
Args map[string]interface{}
}
ExchangeOpt contains options for the exchange.
type QueueOpt ¶
type QueueOpt struct {
Durable bool
AutoDelete bool
Exclusive bool
NoWait bool
Args map[string]interface{}
}
QueueOpt contains options for the queue.
type Receiver ¶
type Receiver struct{}
Receiver contains data for receiving messages from the queue.
func NewReceiver ¶
NewReceiver create & init the Receiver struct.
type Sender ¶
type Sender struct {
Cnn string
Exchange string
ExchangeDeclare bool
ExchangeOpt ExchangeOpt
// contains filtered or unexported fields
}
Sender contains data for sending messages.
func (*Sender) Connect ¶
Connect creates a connection to the amqp-server and starts the message sending loop.
func (*Sender) NotifyError ¶
NotifyError registers a listener for when the server sends a exception.
type Subscriber ¶
type Subscriber struct {
Connection string
Queue string
Exchange string
PrefetchCount int
PassiveMode bool
AmqpConfig *amqp.Config
QueueOpt QueueOpt
ConsumeOpt ConsumeOpt
}
Subscriber contains data for subscribing to messages from the queue.
func NewSubscriber ¶
func NewSubscriber(cnn, queue string) *Subscriber
NewSubscriber create & init the Subscriber struct.
func (*Subscriber) AddQueueArg ¶
func (s *Subscriber) AddQueueArg(key string, value interface{}) *Subscriber
AddQueueArg add argument to QueueOpt field.
func (*Subscriber) Process ¶
func (s *Subscriber) Process(h func([]byte) error) error
Process starts a message loop.
func (*Subscriber) SetAmqpConfig ¶
func (s *Subscriber) SetAmqpConfig(config amqp.Config) *Subscriber
SetAmqpConfig sets the AmqpConfig
func (*Subscriber) SetExchange ¶
func (s *Subscriber) SetExchange(ex string) *Subscriber
SetExchange set the Exchange field.
func (*Subscriber) SetPassiveMode ¶
func (s *Subscriber) SetPassiveMode(mode bool) *Subscriber
SetPassiveMode sets the Passive Mode status
func (*Subscriber) SetPrefetchCount ¶
func (s *Subscriber) SetPrefetchCount(n int) *Subscriber
SetPrefetchCount set the PrefetchCount field.