publisher

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2025 License: MIT Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPublisherIsNotInitialized = errors.New("publisher is not initialized")
)

Functions

This section is empty.

Types

type Middleware

type Middleware func(next RoundTripper) RoundTripper

func PersistentMode

func PersistentMode() Middleware

type Option

type Option func(publisher *Publisher)

func WithMiddlewares

func WithMiddlewares(middlewares ...Middleware) Option

type Publisher

type Publisher struct {
	Exchange    string
	RoutingKey  string
	Middlewares []Middleware
	// contains filtered or unexported fields
}

func New

func New(exchange string, routingKey string, opts ...Option) *Publisher

func (*Publisher) Publish

func (p *Publisher) Publish(ctx context.Context, msg *amqp.Publishing) error

func (*Publisher) PublishTo

func (p *Publisher) PublishTo(ctx context.Context, exchange string, routingKey string, msg *amqp.Publishing) error

func (*Publisher) SetRoundTripper

func (p *Publisher) SetRoundTripper(roundTripper RoundTripper)

type RoundTripper

type RoundTripper interface {
	Publish(ctx context.Context, exchange string, routingKey string, msg *amqp.Publishing) error
}

type RoundTripperFunc

type RoundTripperFunc func(ctx context.Context, exchange string, routingKey string, msg *amqp.Publishing) error

func (RoundTripperFunc) Publish

func (f RoundTripperFunc) Publish(ctx context.Context, exchange string, routingKey string, msg *amqp.Publishing) error

Jump to

Keyboard shortcuts

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