Documentation ¶
Index ¶
- type Amqp
- func (s *Amqp) Close()
- func (s *Amqp) Config(params map[string]string) error
- func (s *Amqp) Dial() error
- func (s *Amqp) NewChannel() (*amqpDriver.Channel, error)
- func (s *Amqp) NotifyClose(c adapters.CloseListener)
- func (s *Amqp) SetDialPolicy(policy dial.Policy)
- func (s *Amqp) SetLogger(logger *log.Logger)
- func (s *Amqp) SetOptions(opts ...adapters.ServiceOption) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Amqp ¶
type Amqp struct { // A mutex protecting dial attempts. sync.Mutex // contains filtered or unexported fields }
var Adapter *Amqp = &Amqp{ endpoint: "localhost:55672", logger: log.New(ioutil.Discard, "", log.LstdFlags), dialPolicy: dial.ExpBackoff(10, time.Millisecond), closeNotifier: adapters.NewNotifier(), }
Adapter is a singleton instance of a amqp service
func (*Amqp) Config ¶
Set the service configuration. Changing the configuration settings for an already connected service will trigger a service shutdown. The service consumer is responsible for handing service close events and triggering a re-dial.
func (*Amqp) Dial ¶
Connect to the service. If a dial policy has been specified, the service will keep trying to reconnect until a connection is established or the dial policy aborts the reconnection attempt.
func (*Amqp) NewChannel ¶
func (s *Amqp) NewChannel() (*amqpDriver.Channel, error)
Allocate new amqp channel.
func (*Amqp) NotifyClose ¶
func (s *Amqp) NotifyClose(c adapters.CloseListener)
Register a listener for receiving close notifications. The service adapter will emit an error and close the channel if the service is cleanly shut down or close the channel if the connection is reset.
func (*Amqp) SetDialPolicy ¶
Set a dial policy for this service.
func (*Amqp) SetOptions ¶
Apply a list of options to the service.