producer

package
v0.0.0-...-3414fa2 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Options)

func WithAsync

func WithAsync() Option

func WithBatch

func WithBatch(size int, timeout time.Duration) Option

func WithExchange

func WithExchange(exchange string) Option

func WithHeaders

func WithHeaders(headers amqp.Table) Option

func WithPersistentDelivery

func WithPersistentDelivery() Option

func WithRoutingKey

func WithRoutingKey(key string) Option

type Options

type Options struct {
	Exchange     string
	RoutingKey   string
	Mandatory    bool
	Immediate    bool
	Headers      amqp.Table
	DeliveryMode uint8
	Async        bool
	BatchSize    int
	BatchTimeout time.Duration
}

type Producer

type Producer struct {
	// contains filtered or unexported fields
}

func NewProducer

func NewProducer(ch *amqp.Channel, opts ...Option) *Producer

func (*Producer) Close

func (p *Producer) Close() error

func (*Producer) Publish

func (p *Producer) Publish(ctx context.Context, msg interface{}) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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