rabbitmq

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BotMessagePayload

type BotMessagePayload struct {
	Command  string `json:"command"`
	Argument string `json:"argument"`
}

BotMessagePayload is the data envelopment published to bots

type Client

type Client struct {
	Channel *amqp.Channel
	// contains filtered or unexported fields
}

Client publishes and consumes messages on RabbitMQ queues

func NewClient

func NewClient(channel *amqp.Channel, requestQueue, responseQueue string, logger *log.Entry) *Client

NewClient instantiates a new Rabbit MQ client

func (*Client) Consume

func (c *Client) Consume() (<-chan amqp.Delivery, error)

Consume receives a message from the response queue

func (*Client) Publish

func (c *Client) Publish(payload json.RawMessage) error

Publish sends a message to the command queue

func (*Client) QueueDeclare

func (c *Client) QueueDeclare() error

QueueDeclare declares the queues so we can publish and consume messages

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL