amqp

package
v4.74.3 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 18 Imported by: 9

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(config *Config, meterProvider metric.MeterProvider, tracerProvider trace.TracerProvider) (*Client, error)

func NewFromURI added in v4.28.3

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

func (*Client) Close

func (c *Client) Close()

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) (err 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(fs *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