publisher

package
v0.101.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AmqpClient

type AmqpClient interface {
	DialConfig(url string, config amqp.Config) (Connection, error)
}

func NewAmqpClient

func NewAmqpClient() AmqpClient

type Channel

type Channel interface {
	Confirm(noWait bool) error
	PublishWithDeferredConfirmWithContext(ctx context.Context, exchange, key string, mandatory, immediate bool, msg amqp.Publishing) (DeferredConfirmation, error)
	IsClosed() bool
	Close() error
}

type Connection

type Connection interface {
	IsClosed() bool
	Channel() (Channel, error)
	NotifyClose(receiver chan *amqp.Error) chan *amqp.Error
	Close() error
}

type DeferredConfirmation

type DeferredConfirmation interface {
	Done() <-chan struct{}
	Acked() bool
}

type DialConfig

type DialConfig struct {
	URL                        string
	Durable                    bool
	Vhost                      string
	Auth                       amqp.Authentication
	ConnectionTimeout          time.Duration
	Heartbeat                  time.Duration
	PublishConfirmationTimeout time.Duration
	TLS                        *tls.Config
	ConnectionName             string
}

type Message

type Message struct {
	Exchange   string
	RoutingKey string
	Body       []byte
}

type Publisher

type Publisher interface {
	Publish(ctx context.Context, message Message) error
	Close() error
}

func NewConnection

func NewConnection(logger *zap.Logger, client AmqpClient, config DialConfig) (Publisher, error)

Jump to

Keyboard shortcuts

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