Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents the client with connection to RabbitMQ.
func (*Client) Subscribe ¶
func (c *Client) Subscribe(cg ConsumerConfig, subHandler SubscribeHandler) error
Subscribe subscribe in a queue in exchange to consume events that is published in her. Open a new channel in the client connection. Passing the parameters of name of exchange, type of exchange (direct, topic or fanout), queue name, binding key. And a handler function to execute in consume, where stay the business logic for execute when the event is received.
type ConsumerConfig ¶
type ConsumerConfig struct { ExchangeName string ExchangeType string // fanout, topic, direct QueueName string BindingKey string ConsumerName string }
ConsumerConfig represents all configs to create and configure a subscribe/consumer
type Message ¶
Message represents the message/event receive in consumer of RabbitMQ with the body and all fields of delivered message
type RabbitMQ ¶
type RabbitMQ interface { Close() Ping() error Subscribe(cg ConsumerConfig, subHandler SubscribeHandler) error }
RabbitMQ represents the functions to connect and subribe in RabbitMQ