rabbitmq

package module
v0.0.0-...-c481cca Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2019 License: MIT Imports: 3 Imported by: 3

README

rabbitmq

rabbitmq wrapper used in Godin

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsumeHandler

type ConsumeHandler func(delivery amqp.Delivery)

type Consumer

type Consumer struct {
	Consumer   *cony.Consumer
	Handler    ConsumeHandler
	RoutingKey string
}

func NewConsumer

func NewConsumer(client *cony.Client, exchangeName string, queueName string, routingKey string, handler ConsumeHandler, opt ...cony.ConsumerOpt) *Consumer

func (*Consumer) Handle

func (c *Consumer) Handle(msg amqp.Delivery)

Handle will filter the passed amqp.Delivery based on the routing key Only the configured routing key is handled, all others are NACKed and requeued. If the delivery has the correct routing key, the handler is called.

type Producer

type Producer struct {
	Publisher *cony.Publisher
}

func NewProducer

func NewProducer(client *cony.Client, exchangeName string, topic string, opts ...cony.PublisherOpt) *Producer

func (*Producer) Publish

func (p *Producer) Publish(event interface{}) error

type Publisher

type Publisher interface {
	Publish(event interface{}) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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