Documentation
¶
Overview ¶
version: 0.0.1 file to manage channel
version: 0.0.1 file to manage connection
version: 0.0.1 file to build exchange
version: 0.0.1 broker wrapper is lib to manage creation of exchanges and consumers only type supported is rabbitmq
version: 0.0.1 file publish messages
Index ¶
- Variables
- type Broker
- func (e *Broker) AddConnection(ctype string) (*Connection, error)
- func (b *Broker) BuildExchange(name string, opts ...*ExchangeOptions) (*Exchange, error)
- func (e *Broker) GetConnection(ctype string) (*Connection, error)
- func (b *Broker) PublishToExchange(exchangeName, routekey string, body interface{}, opts ...*PublishOptions) error
- func (b *Broker) QueueDeclareAndBind(exchange, routeKey, queueName string) (string, error)
- func (b *Broker) RunConsumer(exchange, routeKey string, functions func([]byte), queueName string) error
- type Channel
- type Connection
- type EndpointOptions
- type Exchange
- func (e *Exchange) Publish(routekey string, body interface{}, opts ...*PublishOptions) error
- func (e *Exchange) QueueDeclareAndBind(exchange, routeKey, queueName string, ch *Channel) (string, error)
- func (e *Exchange) RunConsumer(exchange, routeKey string, functions func([]byte), queueName string) error
- type ExchangeOptions
- type PublishOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var ( PublishConnection = "publish" ConsumerConnection = "consume" )
connection types
Functions ¶
This section is empty.
Types ¶
type Broker ¶
type Broker struct { Endpoint string Type string // only rabbitmq supported // contains filtered or unexported fields }
broker struct
func (*Broker) AddConnection ¶
func (e *Broker) AddConnection(ctype string) (*Connection, error)
create tls connection to borker
func (*Broker) BuildExchange ¶
func (b *Broker) BuildExchange(name string, opts ...*ExchangeOptions) (*Exchange, error)
build exchange
func (*Broker) GetConnection ¶
func (e *Broker) GetConnection(ctype string) (*Connection, error)
func (*Broker) PublishToExchange ¶
func (b *Broker) PublishToExchange(exchangeName, routekey string, body interface{}, opts ...*PublishOptions) error
expose method to publish messages to exchange
func (*Broker) QueueDeclareAndBind ¶
only declare and bind
type Connection ¶
type Connection struct { *amqp.Connection Status string Type string ChannelPool map[int]*Channel // contains filtered or unexported fields }
func (*Connection) AddChannel ¶
func (c *Connection) AddChannel() (*Channel, error)
create channel for rabbitmq
func (*Connection) GetChannel ¶
func (c *Connection) GetChannel(id ...int) (*Channel, error)
get channel can take id to get specific channel
type EndpointOptions ¶
broker options like username password
type Exchange ¶
type Exchange struct {
// contains filtered or unexported fields
}
exchane struct
func (*Exchange) Publish ¶
func (e *Exchange) Publish(routekey string, body interface{}, opts ...*PublishOptions) error
expose method to publish messages to exchange
type ExchangeOptions ¶
type ExchangeOptions struct { Type string Durable bool AutoDelete bool Internal bool NoWait bool Args amqp.Table }
exchange options
type PublishOptions ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.