topology

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2025 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DLXName   = "default-dead-letter"
	DLQSuffix = "DLQ"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Binding

type Binding struct {
	ExchangeName string
	QueueName    string
	RoutingKey   string
	Args         amqp.Table
}

func NewBinding

func NewBinding(exchangeName string, queueName string, routingKey string) *Binding

type Declarations

type Declarations struct {
	Exchanges []*Exchange
	Queues    []*Queue
	Bindings  []*Binding
}

func Compile

func Compile(cfg Declarations) Declarations

func New

func New(opts ...DeclarationsOption) Declarations

type DeclarationsOption

type DeclarationsOption func(d *Declarations)

func WithBinding

func WithBinding(exchangeName string, queueName string, routingKey string) DeclarationsOption

func WithDirectExchange

func WithDirectExchange(name string) DeclarationsOption

func WithFanoutExchange

func WithFanoutExchange(name string) DeclarationsOption

func WithQueue

func WithQueue(name string, opts ...QueueOption) DeclarationsOption

func WithTopicExchange

func WithTopicExchange(name string) DeclarationsOption

type Exchange

type Exchange struct {
	Name string
	Type string
	Args amqp.Table
}

func NewDirectExchange

func NewDirectExchange(name string) *Exchange

func NewFanoutExchange

func NewFanoutExchange(name string) *Exchange

func NewTopicExchange

func NewTopicExchange(name string) *Exchange

type Queue

type Queue struct {
	Name        string
	DLQ         bool
	Durable     bool
	AutoDelete  bool
	RetryPolicy *retry.Policy
	Args        amqp.Table
}

func NewQueue

func NewQueue(name string, opts ...QueueOption) *Queue

type QueueOption

type QueueOption func(q *Queue)

func WithAutoDelete

func WithAutoDelete(value bool) QueueOption

func WithDLQ

func WithDLQ(value bool) QueueOption

func WithDurable

func WithDurable(value bool) QueueOption

func WithQueueArg

func WithQueueArg(key string, value any) QueueOption

func WithRetryPolicy

func WithRetryPolicy(policy retry.Policy) QueueOption

Jump to

Keyboard shortcuts

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