Documentation ¶
Index ¶
- Variables
- type Config
- type Session
- func (session *Session) Ack(tag uint64) error
- func (session *Session) Bind(routingKey string) error
- func (session *Session) Close() error
- func (session *Session) Push(routingKey string, data amqp.Publishing) error
- func (session *Session) Stream(consumer string, autoAck bool, exclusive bool) (<-chan amqp.Delivery, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotConnected is returned when not connected to a server ErrNotConnected = errors.New("not connected to a server") // ErrAlreadyClosed is returned when the connection is already closed ErrAlreadyClosed = errors.New("already closed: not connected to the server") // ErrShutdown is returned when already shutting down ErrShutdown = errors.New("session is shutting down") // ErrNack is returned when a message publish fails with a NACK ErrNack = errors.New("message was not sent") // ErrPublishOnly is returned when a channel is publish only and you try and use a queue function ErrPublishOnly = errors.New("channel is publish only") // ErrTimedOut is returned when a message times out waiting for confirmation ErrTimedOut = errors.New("confirmation timed out") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Name string Exchange string Addr string DurableQueue bool DeleteUnused bool Exclusive bool Args amqp.Table Qos int PublishOnly bool }
Config for the session
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session is the rabbitmq session
func New ¶
New creates a new consumer state instance, and automatically attempts to connect to the server.
func (*Session) Push ¶
func (session *Session) Push(routingKey string, data amqp.Publishing) error
Push will publish data to channel
func (*Session) Stream ¶
func (session *Session) Stream(consumer string, autoAck bool, exclusive bool) (<-chan amqp.Delivery, error)
Stream will continuously put queue items on the channel. It is required to call delivery.Ack when it has been successfully processed, or delivery.Nack when it fails. Ignoring this will cause data to build up on the server.
Click to show internal directories.
Click to hide internal directories.