publish

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel interface {
	PublishWithContext(ctx context.Context, exchange, key string, mandatory, immediate bool, msg amqp.Publishing) error
}

Channel is a RabbitMQ channel for publishing.

func Wrap

func Wrap(channel Channel, mws ...Middleware) Channel

Wrap channel with middlewares.

type ChannelFunc

type ChannelFunc func(ctx context.Context, exchange, key string, mandatory, immediate bool, msg amqp.Publishing) error

ChannelFunc type is an adapter to allow the use of ordinary functions as Channel.

func (ChannelFunc) PublishWithContext

func (f ChannelFunc) PublishWithContext(ctx context.Context, exchange, key string, mandatory, immediate bool, msg amqp.Publishing) error

PublishWithContext implements Channel.

type Middleware

type Middleware func(Channel) Channel

Middleware adds new functionality for publishing.

func WithExpiration

func WithExpiration(expire time.Duration) Middleware

WithExpiration sets publishing Expire property.

func WithHeaders

func WithHeaders(table amqp.Table) Middleware

WithHeaders adds headers to the published message.

Jump to

Keyboard shortcuts

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