Versions in this module Expand all Collapse all v1 v1.0.3 Sep 19, 2026 v1.0.2 Sep 19, 2026 Changes in this version + const DefaultContentType + var ErrBindQueueToExchange = errors.New("error binding queue to exchange") + var ErrClientClosedBeforeReady = errors.New("client closed before ready") + var ErrClosingQueueChannel = errors.New("error closing queue channel") + var ErrClosingQueueConnection = errors.New("error closing queue connection") + var ErrConnectToQueue = errors.New("failed to connect to queue at address") + var ErrConsumeQueueConnectionClosed = errors.New("queue connection closed during consume") + var ErrConsumersAlreadyStarted = errors.New("consumers already started") + var ErrContextCanceledBeforeAck = errors.New("context canceled before publish confirm") + var ErrContextCanceledOnConsumerStart = errors.New("context canceled while starting consumers") + var ErrDoneSignalBeforeAck = errors.New("done signal received before publish confirm") + var ErrEmptyURL = errors.New("RabbitMQ URL is not set") + var ErrEnableConfirms = errors.New("failed to enable publisher confirms") + var ErrFailHandlerRequired = errors.New("retry enabled but WithFailHandler was not provided") + var ErrInvalidDelay = errors.New("config delay must be greater than zero") + var ErrInvalidPriority = errors.New("message priority must be in range 0–9") + var ErrInvalidRetryConfig = errors.New("invalid retry configuration") + var ErrNoConsumersRegistered = errors.New("no consumers registered") + var ErrOpenChannel = errors.New("failed to open queue channel") + var ErrPublishFailed = errors.New("error publishing message to queue") + var ErrPublishNack = errors.New("broker nacked the published message") + var ErrPushQueueConnectionClosed = errors.New("queue connection closed during publish") + var ErrQueueConnectionClosed = errors.New("queue connection closed") + var ErrQueueConsumerOnly = errors.New("queue is configured for consume only (ConsumerOnly)") + var ErrQueueNotFound = errors.New("queue not found in configuration") + var ErrStartingQueueConsumption = errors.New("error starting queue consumption") + func IsRetryable(err error) bool + func Retry(err error) error + type Config struct + QueueParams map[QueueName]QueueItem + ReInitDelay time.Duration + ReconnectDelay time.Duration + ResendDelay time.Duration + URL string + type ConsumeHeadersExtractor func(parent context.Context, headers map[string]any) context.Context + type ConsumerHandler func(ctx context.Context, data []byte) error + type FailJobHandler func(job FailedJob) error + type FailedJob struct + Body []byte + Err error + Queue QueueName + type Logger interface + Debug func(msg string, args ...any) + DebugContext func(ctx context.Context, msg string, args ...any) + Error func(msg string, args ...any) + ErrorContext func(ctx context.Context, msg string, args ...any) + Info func(msg string, args ...any) + InfoContext func(ctx context.Context, msg string, args ...any) + Warn func(msg string, args ...any) + WarnContext func(ctx context.Context, msg string, args ...any) + type Option func(*options) + func WithConsumeHeadersExtractor(e ConsumeHeadersExtractor) Option + func WithFailHandler(h FailJobHandler) Option + func WithLogger(lgr Logger) Option + func WithPublishHeadersBuilder(b PublishHeadersBuilder) Option + type PublishHeadersBuilder func(ctx context.Context) map[string]any + type PublishMessage struct + Body []byte + ContentType string + MaxRetryDuration *time.Duration + Priority *PublishMessagePriority + type PublishMessagePriority uint8 + type Queue interface + AddConsumer func(ctx context.Context, queue QueueName, handler ConsumerHandler) error + AddConsumerN func(ctx context.Context, queue QueueName, parallelism int, handler ConsumerHandler) error + InitConsumer func(ctx context.Context) error + Publish func(ctx context.Context, queue QueueName, msg PublishMessage) error + Shutdown func(ctx context.Context) error + func New(conf Config, opts ...Option) (Queue, error) + type QueueItem struct + ConsumerOnly bool + Retry *RetryConfig + type QueueName string + type RetryConfig struct + Delay time.Duration + MaxDuration time.Duration + type RetryableError struct + Err error + func (e *RetryableError) Error() string + func (e *RetryableError) Unwrap() error