Documentation ¶
Index ¶
- type Config
- type Rabbit
- func (c *Rabbit) AddExtraExchange(name string)
- func (c *Rabbit) AutoConnect(timeout int)
- func (c *Rabbit) Close()
- func (c *Rabbit) IsOpen() bool
- func (c *Rabbit) Push(key string, message string, exchange string) error
- func (c *Rabbit) Subscribe(receiver string, handler func(*amqp.Delivery)) error
- func (c *Rabbit) SubscribeWithBindings(bindings []string, receiver string, handler func(*amqp.Delivery)) error
- func (c *Rabbit) Unsubscribe()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Host string `json:"host"` Exchange string `json:"exchange"` BindingKey string `json:"bindingkey"` Verbose bool `json:"verbose"` Timeout int `json:"timeout"` }
Config is configuration structure - Host: IP or hostname to RabbitMQ server - Exchange: exchange to subscribe from - BindingKey: key to select messages - Verbose: log verbose - Timeout: deprecated
type Rabbit ¶
type Rabbit struct {
// contains filtered or unexported fields
}
Rabbit is a client to RabbitMQ
func (*Rabbit) AddExtraExchange ¶
AddExtraExchange creates new exchange connection
func (*Rabbit) AutoConnect ¶
AutoConnect is acync methon to establish aand keep connection
func (*Rabbit) SubscribeWithBindings ¶
func (c *Rabbit) SubscribeWithBindings(bindings []string, receiver string, handler func(*amqp.Delivery)) error
Subscribe register a callback by receiver's name
func (*Rabbit) Unsubscribe ¶
func (c *Rabbit) Unsubscribe()
Unsubscribe cancels subscription to default exchange
Click to show internal directories.
Click to hide internal directories.