Versions in this module Expand all Collapse all v0 v0.1.0 Jan 4, 2023 Changes in this version + var ErrTooManyFailures = errors.New("too many consecutive failures") + type Connection struct + func NewConnection(factory ConnectionFactory, backoff backoff.Backoff) (*Connection, error) + func NewConnectionWithContext(ctx context.Context, factory ConnectionFactory, backoff backoff.Backoff) (*Connection, error) + func (c *Connection) Close() + func (c *Connection) IsAlive() bool + func (c *Connection) NotifyClose(ch chan error) chan error + func (c *Connection) NotifyReconnect(ch chan error) chan error + type ConnectionFactory func() (*amqp.Connection, error) + type ConsumerParams struct + AutoAck bool + ConsumerArgs amqp.Table + ConsumerName string + type ControllerFunc func(ctx *DeliveryContext) + type DeliveryContext struct + Channel *amqp.Channel + Delivery amqp.Delivery + func NewDeliveryContext(baseCtx context.Context, delivery amqp.Delivery, ch *amqp.Channel) *DeliveryContext + func (c *DeliveryContext) Ack() bool + func (c *DeliveryContext) BindJSON(ptr interface{}) error + func (c *DeliveryContext) Nack(requeue bool, err error) bool + type ExchangeParams struct + Args amqp.Table + AutoDelete bool + Durable bool + Internal bool + Kind string + Name string + NoWait bool + type GroupOption func(g *RouterGroup) + func WithNumWorkers(workers int) GroupOption + func WithRouterEngine(engine RouterEngine) GroupOption + type Publisher struct + Conn *Connection + func NewPublisher(connection *Connection, exchangeParams ExchangeParams, opts ...PublisherOption) (*Publisher, error) + func (p *Publisher) Broken() bool + func (p *Publisher) Publish(ctx context.Context, key string, mandatory, immediate bool, ...) error + type PublisherOption func(p *Publisher) + func WithQueueDeclaration(queueParams QueueParams, bindingKey string) PublisherOption + func WithRetries(backoff backoff.Backoff, consecutiveFailuresBeforeBreak uint32) PublisherOption + type QualityOfService struct + PrefetchCount int + PrefetchSize int + type QueueParams struct + Args amqp.Table + AutoDelete bool + Durable bool + Exclusive bool + Name string + NoWait bool + type Router struct + func NewRouter() *Router + func (r *Router) Group(exchange ExchangeParams, queue QueueParams, qos QualityOfService, ...) *RouterGroup + type RouterEngine interface + AddBinding func(bindingKey string, controllers ...ControllerFunc) + Route func(routingKey string) []ControllerFunc + func NewDirectRouterEngine() RouterEngine + func NewTopicRouterEngine() RouterEngine + type RouterGroup struct + func (g *RouterGroup) Route(routingKey string, controllers ...ControllerFunc) *RouterGroup + type Server struct + Conn *Connection + func NewServer(conn *Connection, router *Router) *Server + func (s *Server) ListenAndServe(ctx context.Context) error + func (s *Server) Shutdown(ctx context.Context) error