pubsub

package
v0.0.0-...-e96b286 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PubSub

type PubSub struct {
	Config  *config.AMQPConfig
	Conn    *amqp.Connection
	Channel *amqp.Channel
}

func New

func New(cfg *config.AMQPConfig) *PubSub

func (*PubSub) Connect

func (p *PubSub) Connect() error

func (*PubSub) Initialize

func (p *PubSub) Initialize() error

func (*PubSub) Publish

func (p *PubSub) Publish(routingKey string, contentType string, body []byte) error

Publish a byte string using a given routing key (in our case, always the queue name)

func (*PubSub) PublishJSON

func (p *PubSub) PublishJSON(routingKey string, data interface{}) error

Shortcut to publishing arbitrary interfaces

as JSON

func (*PubSub) QueueDeclare

func (p *PubSub) QueueDeclare(name string) (amqp.Queue, error)

Setup a persistent queue

func (*PubSub) SetupChannel

func (p *PubSub) SetupChannel() error

Jump to

Keyboard shortcuts

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