rabbit

package
v0.0.0-...-32823bc Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const MAX_MSG_RETRY = 3

const MSG_SIZE = 1024 max retry to send a message

Variables

View Source
var AmqpConn *amqp.Connection
View Source
var EmailWorkers map[string]*WorkerList

Functions

func Close

func Close()

func Connect

func Connect()

func Setup

func Setup()

Types

type Channel

type Channel struct {
	Exchange   string
	RoutingKey string
	QueueName  string
	Ack        bool
	Mandatory  bool
	Immendiate bool

	Queue    amqp.Queue
	Messages <-chan amqp.Delivery
	// contains filtered or unexported fields
}

A custom Amqp Channel struct and functions that extends the functionality of Amqp

var BatchChannel Channel
var LogChannel Channel
var LogDB Channel
var MailGunChannel Channel
var SendGridChannel Channel
var WebhookChannel Channel

func (*Channel) Bind

func (c *Channel) Bind() bool

Bind the Queue to the Exchange

func (*Channel) DeclareExchange

func (c *Channel) DeclareExchange() error

Declare Exchange

func (*Channel) DeclareQueue

func (c *Channel) DeclareQueue() bool

Create a Queue and connect to exchange with defined route keys

func (*Channel) Listen

func (c *Channel) Listen(listener RabbitListener) bool

Attaches a consumer listener on defined routing key and config

func (*Channel) NewChannel

func (c *Channel) NewChannel() error

Create a new amqp Channel

func (*Channel) Publish

func (c *Channel) Publish(routingKey string, data []byte) bool

Publish on Queue

func (*Channel) SetQos

func (c *Channel) SetQos(num int)

Set QOS option

type RabbitListener

type RabbitListener func(d amqp.Delivery)

type WorkerList

type WorkerList struct {
	Channel   *Channel
	Namespace string
}

Jump to

Keyboard shortcuts

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