Documentation ¶
Index ¶
- Constants
- Variables
- type Callback
- type ConsumerSetting
- type Hedwig
- func (h *Hedwig) AddQueue(qSetting *QueueSetting, qName string) error
- func (h *Hedwig) Consume() error
- func (h *Hedwig) Disconnect() error
- func (h *Hedwig) Publish(key string, body []byte) (err error)
- func (h *Hedwig) PublishWithDelay(key string, body []byte, delay time.Duration) (err error)
- func (h *Hedwig) PublishWithHeaders(key string, body []byte, headers map[string]interface{}) (err error)
- type QueueSetting
- type Settings
Constants ¶
View Source
const ( PublishChannel = "publish" SubscribeChannel = "subscribe" )
View Source
const ( // For exchanges which use RMQ delay plugin, following type should be used as ExchangeType ExchangeTypeDelayed = "x-delayed-message" // Delayed Type Exchanges also need an extra arg with following key with the value set to actual ExchangeType // like `direct`, `topic` etc DelayedExchangeArgKey = "x-delayed-type" // Following header should be used when you are publishing to an Delay exchange. The header value will be // delay in milliseconds DelayHeader = "x-delay" )
Variables ¶
View Source
var ( ErrNilHedwig = errors.New("hedwig is nil, use `New` to create an instance") ErrAlreadyInitialized = errors.New("already initialized, disconnect before attempting again") ErrNoBindings = errors.New("no bindings provided, need at least one") ErrNoConsumerSetting = errors.New("consumer setting is nil") )
Functions ¶
This section is empty.
Types ¶
type ConsumerSetting ¶
type ConsumerSetting struct { Queues map[string]*QueueSetting // contains filtered or unexported fields }
type Hedwig ¶
type Hedwig struct { sync.Mutex Settings *Settings Error error // contains filtered or unexported fields }
func (*Hedwig) Disconnect ¶
func (*Hedwig) PublishWithDelay ¶
type QueueSetting ¶
type QueueSetting struct { Bindings []string Callback Callback Durable bool AutoDelete bool Exclusive bool NoAck bool }
func DefaultQueueSetting ¶
func DefaultQueueSetting(callback Callback, bindings ...string) *QueueSetting
type Settings ¶
type Settings struct { Exchange string ExchangeType string ExchangeArgs amqp.Table HeartBeatInterval time.Duration SocketTimeout time.Duration Host string Port int Vhost string Username string Password string Consumer *ConsumerSetting }
func DefaultSettings ¶
func DefaultSettings() *Settings
Click to show internal directories.
Click to hide internal directories.