Versions in this module Expand all Collapse all v1 v1.0.0 May 5, 2023 Changes in this version + var DefaultAppID = "p-rabbit-" + uuid.NewV4().String()[0:8] + var DefaultConsumerTag = "c-rabbit-" + uuid.NewV4().String()[0:8] + var ErrShutdown = errors.New("connection has been shutdown") + func ValidateOptions(opts *Options) error + type Binding struct + BindingKeys []string + ExchangeAutoDelete bool + ExchangeDeclare bool + ExchangeDurable bool + ExchangeName string + ExchangeType string + type ConsumeError struct + Error error + Message *amqp.Delivery + type IRabbit interface + Close func() error + Consume func(ctx context.Context, errChan chan *ConsumeError, ...) + ConsumeOnce func(ctx context.Context, runFunc func(msg amqp.Delivery) error) error + PublishWithContext func(ctx context.Context, routingKey string, msg amqp.Publishing) error + Stop func() error + type Logger interface + Debug func(args ...interface{}) + Debugf func(format string, args ...interface{}) + Error func(args ...interface{}) + Errorf func(format string, args ...interface{}) + Info func(args ...interface{}) + Infof func(format string, args ...interface{}) + Warn func(args ...interface{}) + Warnf func(format string, args ...interface{}) + type Mode int + const Both + const Consumer + const DefaultRetryReconnectSec + const Producer + type NoOpLogger struct + func (l *NoOpLogger) Debug(args ...interface{}) + func (l *NoOpLogger) Debugf(format string, args ...interface{}) + func (l *NoOpLogger) Error(args ...interface{}) + func (l *NoOpLogger) Errorf(format string, args ...interface{}) + func (l *NoOpLogger) Info(args ...interface{}) + func (l *NoOpLogger) Infof(format string, args ...interface{}) + func (l *NoOpLogger) Warn(args ...interface{}) + func (l *NoOpLogger) Warnf(format string, args ...interface{}) + type Options struct + AppID string + AutoAck bool + Bindings []Binding + ConsumerTag string + Log Logger + Mode Mode + QosPrefetchCount int + QosPrefetchSize int + QueueArgs map[string]interface{} + QueueAutoDelete bool + QueueDeclare bool + QueueDurable bool + QueueExclusive bool + QueueName string + RetryReconnectSec int + SkipVerifyTLS bool + URLs []string + UseTLS bool + type Rabbit struct + Conn *amqp.Connection + ConsumeLooper director.Looper + ConsumerDeliveryChannel <-chan amqp.Delivery + ConsumerRWMutex *sync.RWMutex + NotifyCloseChan chan *amqp.Error + Options *Options + ProducerRWMutex *sync.RWMutex + ProducerServerChannel *amqp.Channel + func New(opts *Options) (*Rabbit, error) + func (r *Rabbit) Close() error + func (r *Rabbit) Consume(ctx context.Context, errChan chan *ConsumeError, ...) + func (r *Rabbit) ConsumeOnce(ctx context.Context, runFunc func(msg amqp.Delivery) error) error + func (r *Rabbit) PublishWithContext(ctx context.Context, routingKey string, msg amqp.Publishing) error + func (r *Rabbit) Stop() error