delivery

package
v0.0.0-...-d1f23fe Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Delivery

type Delivery interface {
	Ack() error
	Nack(requeue bool) error
	Reject(requeue bool) error
	Body() []byte
	Properties() Properties
	Info() Info
}

Delivery interface describes interface for messages

func New

func New(d amqp.Delivery) Delivery

New creates a new delivery instance from the given AMQP delivery.

type Info

type Info struct {
	MessageCount uint32 `json:"message_count"`
	ConsumerTag  string `json:"consumer_tag"`
	DeliveryTag  uint64 `json:"delivery_tag"`
	Redelivered  bool   `json:"redelivered"`
	Exchange     string `json:"exchange"`
	RoutingKey   string `json:"routing_key"`
}

Info represents the delivery info of an amqp message.

func NewDeliveryInfo

func NewDeliveryInfo(d amqp.Delivery) Info

NewDeliveryInfo creates a new delivery info struct from the AMQP message.

type Properties

type Properties struct {
	Headers         amqp.Table `json:"application_headers"`
	ContentType     string     `json:"content_type"`
	ContentEncoding string     `json:"content_encoding"`
	DeliveryMode    uint8      `json:"delivery_mode"`
	Priority        uint8      `json:"priority"`
	CorrelationID   string     `json:"correlation_id"`
	ReplyTo         string     `json:"reply_to"`
	Expiration      string     `json:"expiration"`
	MessageID       string     `json:"message_id"`
	Timestamp       time.Time  `json:"timestamp"`
	Type            string     `json:"type"`
	UserID          string     `json:"user_id"`
	AppID           string     `json:"app_id"`
}

Properties represents the properties of an AMQP message.

func NewProperties

func NewProperties(d amqp.Delivery) Properties

NewProperties creates a new properties struct from the AMQP message.

Jump to

Keyboard shortcuts

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