Documentation ¶
Overview ¶
Package amqp implements the message broker interface for AMQP compliant brokers (ie RabbitMQ).
Index ¶
- type AMQP
- func (r *AMQP) Close() error
- func (r *AMQP) GetEvents(net string, mut *sync.Mutex) (<-chan types.Trans, <-chan error, error)
- func (r *AMQP) GetReqs(net string, mut *sync.Mutex) (<-chan msg.WalletReq, <-chan error, error)
- func (r *AMQP) SendRequest(net string, wr msg.WalletReq) error
- func (r *AMQP) SendTrans(net string, txs []types.Trans) error
- func (r *AMQP) Setup(x interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AMQP ¶ added in v0.2.2
type AMQP struct {
// contains filtered or unexported fields
}
AMQP implements a connection to a broker and a channel for reuse.
func (*AMQP) Close ¶ added in v0.2.2
Close terminages gracefully the connection to the AMQP message broker. It will close also all channel consumers ending the go routines of GetReqs and GetEvents.
func (*AMQP) GetEvents ¶ added in v0.2.2
GetEvents consumes requests from the "ee" exchange pushing them to the returned channel. The Mutex pointer is provided to ensure the consumed message has been fully dealt with by the management function, so the message consumed is only acknowledged when the mutex is unlocked.
func (*AMQP) GetReqs ¶ added in v0.2.2
GetReqs consumes requests from the "wr" exchange for the specified network pushing them to the returned channel. The Mutex pointer is provided to ensure the consumed message has been fully dealt with by the management function, so the message consumed is only acknowledged when the mutex is unlocked.
func (*AMQP) SendRequest ¶ added in v0.2.2
SendRequest publishes a new wallet request to the "wr" exchange.
func (*AMQP) SendTrans ¶ added in v0.2.2
SendTrans publishes transaction events to the "ee" exchange.