consumer

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: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consumer

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

func NewConsumer

func NewConsumer(ch *amqp.Channel, handler middleware.HandlerFunc, opts ...Option) (*Consumer, error)

func (*Consumer) Start

func (c *Consumer) Start(ctx context.Context) error

func (*Consumer) Stop

func (c *Consumer) Stop() error

type Option

type Option func(*Options)

func WithAutoAck

func WithAutoAck(autoAck bool) Option

func WithExchange

func WithExchange(exchange string) Option

func WithMiddlewares

func WithMiddlewares(mws ...middleware.MiddlewareFunc) Option

func WithQueue

func WithQueue(queue string) Option

func WithQueueDeclare

func WithQueueDeclare(declare bool) Option

func WithQueueOptions

func WithQueueOptions(options amqp.Table) Option

func WithRoutingKey

func WithRoutingKey(key string) Option

type Options

type Options struct {
	Exchange     string
	Queue        string
	RoutingKey   string
	AutoAck      bool
	Middlewares  []middleware.MiddlewareFunc
	QueueDeclare bool
	QueueOptions amqp.Table
}

Jump to

Keyboard shortcuts

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