rabbitmq

package
v1.7.6 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPublisherFactory

func NewPublisherFactory(connection *amqp091.Connection) mq.PublisherFactory

func NewSubscriberRegister

func NewSubscriberRegister(channel *amqp091.Channel) mq.SubscriberRegister

Types

type Message

type Message struct {
	amqp091.Delivery
}

func (Message) Ack

func (m Message) Ack() error

func (Message) Body

func (m Message) Body() []byte

func (Message) ID

func (m Message) ID() string

func (Message) NoAck

func (m Message) NoAck() error

type Publisher

type Publisher struct {
	Exchange string
	Key      string
	// contains filtered or unexported fields
}

func (*Publisher) Publish

func (p *Publisher) Publish(ctx context.Context, body []byte) error

type PublisherFactory

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

func (*PublisherFactory) NewPublisher

func (p *PublisherFactory) NewPublisher(topic string) (mq.Publisher, error)

type Subscriber

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

func (*Subscriber) OnMessage

func (s *Subscriber) OnMessage(message mq.Message) error

type SubscriberRegister

type SubscriberRegister struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*SubscriberRegister) Subscribe

func (s *SubscriberRegister) Subscribe(ctx context.Context, subscription string, onMessage func(message mq.Message) error) error

Jump to

Keyboard shortcuts

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