amqp

package
v4.90.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2026 License: MIT Imports: 18 Imported by: 6 modules, 11 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoConfig = errors.New("URI is required")

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, config *Config, meterProvider metric.MeterProvider, tracerProvider trace.TracerProvider) (*Client, error)

func NewFromURI added in v4.28.3

func NewFromURI(ctx context.Context, uri string, prefetch int, meterProvider metric.MeterProvider, tracerProvider trace.TracerProvider) (*Client, error)

func (*Client) Close

func (c *Client) Close(ctx context.Context)

func (*Client) Consumer

func (c *Client) Consumer(queueName, routingKey, exchangeName string, exclusive bool, dlExchange string) (err error)

func (*Client) DelayedExchange added in v4.30.1

func (c *Client) DelayedExchange(queueName, exchangeName, routingKey string, retryDelay time.Duration) (delayExchange string, err error)

func (*Client) Enabled

func (c *Client) Enabled() bool

func (*Client) Exclusive added in v4.29.5

func (c *Client) Exclusive(ctx context.Context, name string, timeout time.Duration, action func(context.Context) error) (acquired bool, err error)

func (*Client) Listen

func (c *Client) Listen(queueResolver QueueResolver, exchange, routingKey string) (string, <-chan amqp.Delivery, error)

func (*Client) Ping

func (c *Client) Ping() error

func (*Client) Publish

func (c *Client) Publish(ctx context.Context, payload amqp.Publishing, exchange, routingKey string) (err error)

func (*Client) PublishJSON added in v4.29.6

func (c *Client) PublishJSON(ctx context.Context, item any, exchange, routingKey string) error

func (*Client) Publisher

func (c *Client) Publisher(exchangeName, exchangeType string, args amqp.Table) (err error)

func (*Client) SetupExclusive added in v4.29.5

func (c *Client) SetupExclusive(ctx context.Context, name string) (err error)

func (*Client) StopListener added in v4.25.0

func (c *Client) StopListener(consumer string) error

func (*Client) Vhost

func (c *Client) Vhost() string

type Config added in v4.28.2

type Config struct {
	URI      string
	Prefetch int
}

func Flags added in v4.28.2

func Flags(flagSet *flag.FlagSet, prefix string, overrides ...flags.Override) *Config

type Connection

type Connection interface {
	io.Closer
	Channel() (*amqp.Channel, error)
	IsClosed() bool
}

type QueueResolver added in v4.30.1

type QueueResolver func() (string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL