rabbitmq

package module
v1.0.35 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2020 License: MIT Imports: 4 Imported by: 0

README

rabbitmq

Abstraction of the AMQP package for use with rabbitmq

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HandlerFunc

type HandlerFunc func(routingKey string, msg []byte)

HandlerFunc - the handler function to deal with this topic

type Rabbit

type Rabbit struct {
	Connection *amqp.Connection
	Channel    *amqp.Channel
}

Rabbit - create rabbit object

func Create

func Create(rbtc RabbitConnection) (Rabbit, error)

Create - create connection

func (*Rabbit) Emit

func (rbt *Rabbit) Emit(rm *RabbitEmitMessage)

Publish - send rabbit message

func (*Rabbit) SubscribeToTopics

func (rbt *Rabbit) SubscribeToTopics(subsc []TopicSubscription)

SubscribeToTopics - subscribe this rabbit to an exchange with a routing key

type RabbitConnection

type RabbitConnection struct {
	URL  string
	Port string
	User string
	Pass string
}

RabbitConnection - a configuration object for the connection to rabbit

type RabbitEmitMessage

type RabbitEmitMessage struct {
	RoutingKey string
	Body       string
}

type RabbitMessageBody

type RabbitMessageBody struct {
	Data  string //data being posted
	Query string //Query parameters for mongodb or elastic
	Ctx   string //Context id
}

type TopicSubscription

type TopicSubscription struct {
	RoutingKey string
	Handler    HandlerFunc
}

TopicSubscription - subscription object

Jump to

Keyboard shortcuts

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