Documentation ¶
Overview ¶
Package amqp contains AMQP API for a remote server.
Index ¶
- type AMQP
- type ConsumeOptions
- type DeclareOptions
- type Exchange
- func (exchange *Exchange) Bind(options ExchangeBindOptions) error
- func (exchange *Exchange) Declare(options ExchangeDeclareOptions) error
- func (exchange *Exchange) Delete(name string, options ExchangeDeleteOptions) error
- func (exchange *Exchange) GetConn(connID int) (*amqpDriver.Connection, error)
- func (exchange *Exchange) Unbind(options ExchangeUnbindOptions) error
- type ExchangeBindOptions
- type ExchangeDeclareOptions
- type ExchangeDeleteOptions
- type ExchangeOptions
- type ExchangeUnbindOptions
- type ListenOptions
- type ListenerType
- type Options
- type PublishOptions
- type Queue
- func (queue *Queue) Bind(options QueueBindOptions) error
- func (queue *Queue) Declare(options DeclareOptions) (amqpDriver.Queue, error)
- func (queue *Queue) Delete(name string, options QueueDeleteOptions) error
- func (queue *Queue) GetConn(connID int) (*amqpDriver.Connection, error)
- func (queue *Queue) Inspect(name string, options QueueInspectOptions) (amqpDriver.Queue, error)
- func (queue *Queue) Purge(name string, noWait bool, options QueuePurgeOptions) (int, error)
- func (queue *Queue) Unbind(options QueueUnbindOptions) error
- type QueueBindOptions
- type QueueDeleteOptions
- type QueueInspectOptions
- type QueueOptions
- type QueuePurgeOptions
- type QueueUnbindOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AMQP ¶
type AMQP struct { Version string Connections *map[int]*amqpDriver.Connection MaxConnID *int Queue *Queue Exchange *Exchange }
AMQP type holds connection to a remote AMQP server.
func (*AMQP) GetConn ¶ added in v0.4.0
func (amqp *AMQP) GetConn(connID int) (*amqpDriver.Connection, error)
GetConn gets an initialised connection by ID, or returns the last initialised one if ID is 0
func (*AMQP) Listen ¶
func (amqp *AMQP) Listen(options ListenOptions) error
Listen binds to an AMQP queue in order to receive message(s) as they are received.
func (*AMQP) Publish ¶
func (amqp *AMQP) Publish(options PublishOptions) error
Publish delivers the payload using options provided.
type ConsumeOptions ¶
type ConsumeOptions struct { Consumer string AutoAck bool Exclusive bool NoLocal bool NoWait bool Args amqpDriver.Table }
ConsumeOptions defines options for use when consuming a message.
type DeclareOptions ¶
type DeclareOptions struct { ConnectionID int Name string Durable bool DeleteWhenUnused bool Exclusive bool NoWait bool Args amqpDriver.Table }
DeclareOptions provides queue options when declaring (creating) a queue.
type Exchange ¶
type Exchange struct { Version string Connections *map[int]*amqpDriver.Connection MaxConnID *int }
Exchange defines a connection to publish/subscribe destinations.
func (*Exchange) Bind ¶
func (exchange *Exchange) Bind(options ExchangeBindOptions) error
Bind subscribes one exchange to another.
func (*Exchange) Declare ¶
func (exchange *Exchange) Declare(options ExchangeDeclareOptions) error
Declare creates a new exchange given the provided options.
func (*Exchange) Delete ¶
func (exchange *Exchange) Delete(name string, options ExchangeDeleteOptions) error
Delete removes an exchange from the remote server given the exchange name.
func (*Exchange) GetConn ¶ added in v0.4.0
func (exchange *Exchange) GetConn(connID int) (*amqpDriver.Connection, error)
GetConn gets an initialised connection by ID, or returns the last initialised one if ID is 0
func (*Exchange) Unbind ¶
func (exchange *Exchange) Unbind(options ExchangeUnbindOptions) error
Unbind removes a subscription from one exchange to another.
type ExchangeBindOptions ¶
type ExchangeBindOptions struct { ConnectionID int DestinationExchangeName string SourceExchangeName string RoutingKey string NoWait bool Args amqpDriver.Table }
ExchangeBindOptions provides options when binding (subscribing) one exchange to another.
type ExchangeDeclareOptions ¶
type ExchangeDeclareOptions struct { ConnectionID int Name string Kind string Durable bool AutoDelete bool Internal bool NoWait bool Args amqpDriver.Table }
ExchangeDeclareOptions provides options when declaring (creating) an exchange.
type ExchangeDeleteOptions ¶ added in v0.4.0
type ExchangeDeleteOptions struct {
ConnectionID int
}
ExchangeDeleteOptions provides options when deleting an exchange.
type ExchangeOptions ¶
type ExchangeOptions struct {
ConnectionURL string
}
ExchangeOptions defines configuration settings for accessing an exchange.
type ExchangeUnbindOptions ¶
type ExchangeUnbindOptions struct { ConnectionID int DestinationExchangeName string SourceExchangeName string RoutingKey string NoWait bool Args amqpDriver.Table }
ExchangeUnbindOptions provides options when unbinding (unsubscribing) one exchange from another.
type ListenOptions ¶
type ListenOptions struct { ConnectionID int Listener ListenerType QueueName string Consumer string AutoAck bool Exclusive bool NoLocal bool NoWait bool Args amqpDriver.Table }
ListenOptions defines options for subscribing to message(s) within a queue.
type ListenerType ¶
ListenerType is the message handler implemented within JavaScript.
type Options ¶
type Options struct {
ConnectionURL string
}
Options defines configuration options for an AMQP session.
type PublishOptions ¶
type PublishOptions struct { ConnectionID int QueueName string Body string Headers amqpDriver.Table Exchange string ContentType string Mandatory bool Immediate bool Persistent bool CorrelationID string ReplyTo string Expiration string MessageID string Timestamp int64 // unix epoch timestamp in seconds Type string UserID string AppID string }
PublishOptions defines a message payload with delivery options.
type Queue ¶
type Queue struct { Version string Connections *map[int]*amqpDriver.Connection MaxConnID *int }
Queue defines a connection to a point-to-point destination.
func (*Queue) Bind ¶
func (queue *Queue) Bind(options QueueBindOptions) error
Bind subscribes a queue to an exchange in order to receive message(s).
func (*Queue) Declare ¶
func (queue *Queue) Declare(options DeclareOptions) (amqpDriver.Queue, error)
Declare creates a new queue given the provided options.
func (*Queue) Delete ¶
func (queue *Queue) Delete(name string, options QueueDeleteOptions) error
Delete removes a queue from the remote server given the queue name.
func (*Queue) GetConn ¶ added in v0.4.0
func (queue *Queue) GetConn(connID int) (*amqpDriver.Connection, error)
GetConn gets an initialised connection by ID, or returns the last initialised one if ID is 0
func (*Queue) Inspect ¶
func (queue *Queue) Inspect(name string, options QueueInspectOptions) (amqpDriver.Queue, error)
Inspect provides queue metadata given queue name.
func (*Queue) Unbind ¶
func (queue *Queue) Unbind(options QueueUnbindOptions) error
Unbind removes a queue subscription from an exchange to discontinue receiving message(s).
type QueueBindOptions ¶
type QueueBindOptions struct { ConnectionID int QueueName string ExchangeName string RoutingKey string NoWait bool Args amqpDriver.Table }
QueueBindOptions provides options when binding a queue to an exchange in order to receive message(s).
type QueueDeleteOptions ¶ added in v0.4.0
type QueueDeleteOptions struct {
ConnectionID int
}
QueueDeleteOptions provide options when deleting a queue.
type QueueInspectOptions ¶ added in v0.4.0
type QueueInspectOptions struct {
ConnectionID int
}
QueueInspectOptions provide options when inspecting a queue.
type QueueOptions ¶
type QueueOptions struct {
ConnectionURL string
}
QueueOptions defines configuration settings for accessing a queue.
type QueuePurgeOptions ¶ added in v0.4.0
type QueuePurgeOptions struct {
ConnectionID int
}
QueuePurgeOptions provide options when purging (emptying) a queue.
type QueueUnbindOptions ¶
type QueueUnbindOptions struct { ConnectionID int QueueName string ExchangeName string RoutingKey string Args amqpDriver.Table }
QueueUnbindOptions provides options when unbinding a queue from an exchange to stop receiving message(s).