rabbit

package
v0.0.0-...-321ad7d Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: Apache-2.0 Imports: 11 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrClosedUnexpectedly = errors.New("channel closed unexpectedly")
	ErrNotInitialized     = errors.New("not initialized")
)

Functions

This section is empty.

Types

type ConfigOption

type ConfigOption func(*MessageBroker)

func WithConsumer

func WithConsumer(name string, prefetchCount int) ConfigOption

func WithStateReporter

func WithStateReporter(f func(bool)) ConfigOption

type MessageBroker

type MessageBroker struct {
	sync.RWMutex

	Connection *amqp.Connection
	Channel    *amqp.Channel
	Queue      *amqp.Queue

	Msgs <-chan amqp.Delivery
	// contains filtered or unexported fields
}

func NewMessageBroker

func NewMessageBroker(address, user, password, queue string, opts ...ConfigOption) (*MessageBroker, error)

func (*MessageBroker) Close

func (mb *MessageBroker) Close() error

func (*MessageBroker) Consume

func (mb *MessageBroker) Consume(ctx context.Context, out proto.Message) error

func (*MessageBroker) Publish

func (mb *MessageBroker) Publish(ctx context.Context, in proto.Message) error

type PublishConsumer

type PublishConsumer interface {
	Publish(ctx context.Context, in proto.Message) error
	Consume(ctx context.Context, out proto.Message) error
}

Jump to

Keyboard shortcuts

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