mq

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package mq

Index

Constants

View Source
const DefaultMessageUUIDHeaderKey = "_message_uuid"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*amqp.Connection
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) (*Client, error)

New create a mq client

func (*Client) IsConnected

func (r *Client) IsConnected() bool

type DefaultMarshal

type DefaultMarshal struct {
	PostprocessPublishing     func(amqp.Publishing) amqp.Publishing
	NotPersistentDeliveryMode bool
	MessageUUIDHeaderKey      string
}

func (DefaultMarshal) Marshal

func (d DefaultMarshal) Marshal(msg *message.Message) (amqp.Publishing, error)

func (DefaultMarshal) Unmarshal

func (d DefaultMarshal) Unmarshal(amqpMsg *amqp.Delivery) (*message.Message, error)

type MarshalAPI

type MarshalAPI interface {
	Marshal(msg *message.Message) (amqp.Publishing, error)
	Unmarshal(amqpMsg *amqp.Delivery) (*message.Message, error)
}

type Option

type Option func(*option)

func WithConfig added in v1.2.2

func WithConfig(cfg *amqp.Config) Option

func WithURI added in v1.2.2

func WithURI(uri string) Option

Jump to

Keyboard shortcuts

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