Documentation
¶
Overview ¶
Package rabbitmq provides a RabbitMQ client, which is suitable for sending and receiving messages. It is expexted to work with a single queue.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrUninitialized is returned when the message queue connection is not initialized. ErrUninitialized = errors.New("rabbitmq is not initialized (initialize connection first?)") // ErrFatal is returned when an unexpected internal error occurs. ErrFatal = errors.New("fatal error") )
Functions ¶
This section is empty.
Types ¶
type ClientType ¶
type ClientType int
ClientType represents a RabbitMQ client type.
const ( // FullClient matches a full client configuration. FullClient ClientType = iota // ProducerOnly matches a client configuration with producer-only fields. ProducerOnly // ConsumerOnly matches a client configuration with consumer-only fields. ConsumerOnly )
type Logger ¶
type Logger interface {
// Info logs a message with level Info on the standard logger.
Info(ctx context.Context, msg string, args ...any)
// Debug logs a message with level Debug on the standard logger.
Debug(ctx context.Context, msg string, args ...any)
// Warn logs a message with level Warn on the standard logger.
Warn(ctx context.Context, msg string, args ...any)
// Error logs a message with level Error on the standard logger.
Error(ctx context.Context, msg string, args ...any)
}
Logger represents an interface of logger visible to the app.
type RabbitMQ ¶
type RabbitMQ struct {
// contains filtered or unexported fields
}
RabbitMQ represents a RabbitMQ client.
func NewRabbitMQ ¶
NewRabbitMQ creates a new RabbitMQ client. Supports partial configuration for different client types: consumer, producer or full client. Unknown client type defaults to FullClient.
Click to show internal directories.
Click to hide internal directories.