Documentation ¶
Index ¶
- Variables
- func CloseDefaultClient()
- func IsInitialized() bool
- type Client
- type Declaration
- func DeclareExchange(name, kind string, durable, autoDelete, internal, noWait bool, args amqp.Table) Declaration
- func DeclareQueue(name string, durable, autoDelete, exclusive, noWait bool, args amqp.Table) Declaration
- func DeclateBinding(name, key, exchange string, noWait bool, args amqp.Table) Declaration
- type DisconnectionHandler
- type ErrHandler
- type MsgHandler
- type SubRequest
- type Subscription
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrHandlerRequired = errors.New("Handler is required") ErrNameRequired = errors.New("Name is required") ErrAlreadyStarted = errors.New("Already started") ErrAlreadyStopped = errors.New("Already closed") ErrSubIsClosed = errors.New("Subscription is closed. Try to create a new one") )
Functions ¶
func CloseDefaultClient ¶
func CloseDefaultClient()
func IsInitialized ¶
func IsInitialized() bool
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func GetDefaultClient ¶
func GetDefaultClient() *Client
func InitDefaultClient ¶
func InitDefaultClient(cfg structure.RabbitConfig) *Client
func MakeClient ¶
func MakeClient(config structure.RabbitConfig) (*Client, error)
func (*Client) Close ¶
func (c *Client) Close(eh ErrHandler)
func (*Client) Declare ¶
func (c *Client) Declare(dls ...Declaration) error
func (*Client) Subscribe ¶
func (c *Client) Subscribe(req SubRequest) (*Subscription, error)
type Declaration ¶
func DeclareExchange ¶
func DeclareExchange(name, kind string, durable, autoDelete, internal, noWait bool, args amqp.Table) Declaration
func DeclareQueue ¶
func DeclareQueue(name string, durable, autoDelete, exclusive, noWait bool, args amqp.Table) Declaration
func DeclateBinding ¶
func DeclateBinding(name, key, exchange string, noWait bool, args amqp.Table) Declaration
type DisconnectionHandler ¶
type ErrHandler ¶
type ErrHandler func(err error)
type MsgHandler ¶
type SubRequest ¶
type SubRequest struct { ConcurrentConsumers int Handler MsgHandler Queue string Name string PrefetchSize int }
type Subscription ¶
type Subscription struct {
// contains filtered or unexported fields
}
func (*Subscription) Close ¶
func (s *Subscription) Close(eh ErrHandler)
func (*Subscription) GetRequest ¶
func (s *Subscription) GetRequest() SubRequest
func (*Subscription) IsActive ¶
func (s *Subscription) IsActive() bool
func (*Subscription) Start ¶
func (s *Subscription) Start() error
Register n concurrent consumers otherwise close all channels and become not reusable
func (*Subscription) Stop ¶
func (s *Subscription) Stop() error
Unregister all otherwise close all channels and become not reusable
Click to show internal directories.
Click to hide internal directories.