rabbitmq

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DeliveryModeTransient  = 1
	DeliveryModePersistent = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Marshaler

type Marshaler interface {
	Unmarshal(d *stdamqp.Delivery) (*event.Metadata, []byte, error)
	Marshal(md *event.Metadata, data []byte) (stdamqp.Publishing, error)
}

type Receiver

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

func NewReceiver

func NewReceiver(client *amqpx.Client, opts ...ReceiverOption) *Receiver

func (*Receiver) Receive

func (r *Receiver) Receive(ctx context.Context, processor eventbus.Processor) error

func (*Receiver) Setup

func (r *Receiver) Setup(ctx context.Context, consumerName string, infos ...eventbus.ServiceInfo) error

type ReceiverOption

type ReceiverOption func(o *receiverOptions)

func WithDLX

func WithDLX() ReceiverOption

func WithIncomingQueue added in v0.2.4

func WithIncomingQueue(queue string) ReceiverOption

func WithMarshaler added in v0.2.0

func WithMarshaler(m Marshaler) ReceiverOption

func WithPrefetchCount

func WithPrefetchCount(c int) ReceiverOption

func WithRequeue added in v0.2.0

func WithRequeue() ReceiverOption

func WithTopologySetup

func WithTopologySetup() ReceiverOption

type Sender

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

func NewSender

func NewSender(client *amqpx.Client, opts ...SenderOption) *Sender

func (*Sender) Send

func (s *Sender) Send(ctx context.Context, meta *event.Metadata, data []byte) error

func (*Sender) Setup

func (s *Sender) Setup(ctx context.Context, desc *eventbus.ServiceDesc) error

type SenderOption

type SenderOption func(opts *senderOptions)

func WithMessageMarshaler

func WithMessageMarshaler(m Marshaler) SenderOption

func WithTransientDeliveryMode

func WithTransientDeliveryMode() SenderOption

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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