Documentation ¶
Index ¶
- func ConvertDeliveryToPublishing(message amqp.Delivery) amqp.Publishing
- type Client
- func (a *Client) Ack(message amqp.Delivery)
- func (a *Client) Close()
- func (a *Client) Consumer(queueName, routingKey, exchangeName string, retryDelay time.Duration) (string, error)
- func (a *Client) Enabled() bool
- func (a *Client) Listen(queue string) (string, <-chan amqp.Delivery, error)
- func (a *Client) Ping() error
- func (a *Client) Publish(payload amqp.Publishing, exchange string) error
- func (a *Client) Publisher(exchangeName, exchangeType string, args amqp.Table) error
- func (a *Client) Reject(message amqp.Delivery, requeue bool)
- func (a *Client) StopListener(consumer string)
- func (a *Client) Vhost() string
- type Config
- type Connection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertDeliveryToPublishing ¶
func ConvertDeliveryToPublishing(message amqp.Delivery) amqp.Publishing
ConvertDeliveryToPublishing convert a delivery to a publishing, for requeuing
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps all object required for AMQP usage
func New ¶
func New(config Config, prometheusRegister prometheus.Registerer) (*Client, error)
New inits AMQP connection from Config
func NewFromURI ¶ added in v4.28.3
func NewFromURI(uri string, prometheusRegister prometheus.Registerer) (*Client, error)
NewFromURI inits AMQP connection from given URI
func (*Client) Consumer ¶
func (a *Client) Consumer(queueName, routingKey, exchangeName string, retryDelay time.Duration) (string, error)
Consumer configures client for consumming from given queue, bind to given exchange, and return delayed Exchange name to publish
func (*Client) Publish ¶
func (a *Client) Publish(payload amqp.Publishing, exchange string) error
Publish sends payload to the underlying exchange
func (*Client) StopListener ¶ added in v4.25.0
StopListener cancel consumer listening
Click to show internal directories.
Click to hide internal directories.