helpers

package module
v0.0.0-...-9c7dd35 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2018 License: MIT Imports: 5 Imported by: 1

README

amqp-helpers

amqp lib helpers for golang

License

MIT © zcong1993

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyMsgToPublishing

func CopyMsgToPublishing(msg amqp.Delivery) *amqp.Publishing

CopyMsgToPublishing copy an Delivery msg into Publishing

func MustBindQueue

func MustBindQueue(ch *amqp.Channel, exchange, qName string, routerKeys []string, args amqp.Table)

MustBindQueue bind queue to exchange or die

func MustDeclareConn

func MustDeclareConn(url string) *amqp.Connection

MustDeclareConn create a connection or die

func MustDeclareConsumer

func MustDeclareConsumer(ch *amqp.Channel, exchange, qName string, routerKeys []string, args amqp.Table) (*amqp.Channel, <-chan amqp.Delivery)

MustDeclareConsumer declare a consumer delivery chan or die

func MustDeclareExchange

func MustDeclareExchange(conn *amqp.Connection, exchange string, args amqp.Table) *amqp.Channel

MustDeclareExchange declare an exchange channel or die

Types

type AmqpDeath

type AmqpDeath struct {
	Count              int       `json:"count"`
	Exchange           string    `json:"exchange"`
	OriginalExpiration string    `json:"original-expiration"`
	Queue              string    `json:"queue"`
	Reason             string    `json:"reason"`
	RoutingKeys        []string  `json:"routing-keys"`
	Time               time.Time `json:"time"`
}

AmqpDeath is struct of "x-death" header

func ParseDeathHeader

func ParseDeathHeader(hs amqp.Table) *AmqpDeath

ParseDeathHeader parse "x-death" header from raw

type Headers

type Headers struct {
	XDeath []AmqpDeath `json:"x-death"`
}

Headers is simple header struct we need

Jump to

Keyboard shortcuts

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