Documentation
¶
Index ¶
- Constants
- Variables
- type AmqpBroker
- func (broker *AmqpBroker) Consume(ctx context.Context, queueName string, config ConsumerConfig) (<-chan Message, <-chan error)
- func (broker *AmqpBroker) GetDialect() Dialect
- func (broker *AmqpBroker) Publish(ctx context.Context, name string, body []byte) error
- func (broker *AmqpBroker) QueueDeclare(ctx context.Context, name string) (string, error)
- type Broker
- type Config
- type ConfigBroker
- type ConsumerConfig
- type Dialect
- type Message
- type Registry
Constants ¶
View Source
const DefaultBroker = "default"
Variables ¶
View Source
var ( ErrUnknownProvider = errors.New("unknown provider") ErrUnableToDetermineDialect = errors.New("unable to determine dialect") )
Functions ¶
This section is empty.
Types ¶
type AmqpBroker ¶
type AmqpBroker struct {
// contains filtered or unexported fields
}
func NewAmqpBroker ¶
func (*AmqpBroker) Consume ¶ added in v0.6.17
func (broker *AmqpBroker) Consume(ctx context.Context, queueName string, config ConsumerConfig) (<-chan Message, <-chan error)
The consumer will automatically reconnect on connection failures.
func (*AmqpBroker) GetDialect ¶
func (broker *AmqpBroker) GetDialect() Dialect
func (*AmqpBroker) QueueDeclare ¶
type Config ¶
type Config struct {
Brokers map[string]ConfigBroker `conf:"BROKERS"`
}
type ConfigBroker ¶
type ConsumerConfig ¶ added in v0.6.17
type ConsumerConfig struct {
// Args additional arguments for declaration
Args map[string]any
// AutoAck when true, the server will automatically acknowledge messages
AutoAck bool
// Exclusive when true, only this consumer can access the queue
Exclusive bool
// NoLocal when true, the server will not send messages to the connection that published them
NoLocal bool
// NoWait when true, the server will not respond to the declare
NoWait bool
}
ConsumerConfig holds configuration for message consumption.
func DefaultConsumerConfig ¶ added in v0.6.17
func DefaultConsumerConfig() ConsumerConfig
DefaultConsumerConfig returns a default configuration for consuming messages.
type Message ¶ added in v0.6.17
type Message struct {
Headers map[string]any
Body []byte
// contains filtered or unexported fields
}
Message represents a consumed message with its metadata and acknowledgment functions.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func (*Registry) AddConnection ¶
func (*Registry) GetDefault ¶ added in v0.6.11
Click to show internal directories.
Click to hide internal directories.