amqp10

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetWatermillUUID

func GetWatermillUUID(msg *amqp.Message) any

func IsConnErr

func IsConnErr(err error) bool

func Marshal

func Marshal(msg *message.Message) (*amqp.Message, error)

func Unmarshal

func Unmarshal(amqpMsg *amqp.Message) (*message.Message, error)

Types

type Config

type Config struct {
	Host      string
	Port      int
	Username  string
	Password  string
	TLSConfig *tls.Config
	Publish   PublishConfig
	Subscribe SubscribeConfig
}

type ConnectionWrapper

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

func NewConnection

func NewConnection(ctx context.Context, config Config) (*ConnectionWrapper, error)

func (*ConnectionWrapper) Close

func (c *ConnectionWrapper) Close() error

type PublishConfig

type PublishConfig struct {
	Durable      bool
	Capabilities []string
}

type Publisher

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

func NewPublisher

func NewPublisher(ctx context.Context, config Config) (*Publisher, error)

func NewPublisherWithConnection

func NewPublisherWithConnection(ctx context.Context, config Config, conn *ConnectionWrapper) (*Publisher, error)

func (*Publisher) Close

func (p *Publisher) Close() error

func (*Publisher) CloseSenders

func (p *Publisher) CloseSenders()

func (*Publisher) Publish

func (p *Publisher) Publish(topic string, messages ...*message.Message) error

type SubscribeConfig

type SubscribeConfig struct {
	QueueName    string
	Durable      bool
	Capabilities []string
}

type Subscriber

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

func NewSubscriber

func NewSubscriber(ctx context.Context, config Config) (*Subscriber, error)

func NewSubscriberWithConnection

func NewSubscriberWithConnection(ctx context.Context, config Config, conn *ConnectionWrapper) (*Subscriber, error)

func (*Subscriber) Close

func (s *Subscriber) Close() error

func (*Subscriber) Subscribe

func (s *Subscriber) Subscribe(ctx context.Context, topic string) (<-chan *message.Message, error)

func (*Subscriber) SubscribeInitialize

func (s *Subscriber) SubscribeInitialize(topic string) error

Jump to

Keyboard shortcuts

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