Versions in this module Expand all Collapse all v1 v1.0.4 Feb 24, 2022 Changes in this version type Config + Qos Qos type Option + func QosGlobal(global bool) Option + func QosPrefetchCount(count int) Option + func QosPrefetchSize(size int) Option + type Qos struct + Global bool + PrefetchCount int + PrefetchSize int v1.0.3 Aug 20, 2021 Changes in this version + const KindDirect + const KindFanout + const KindHeaders + const KindTopic + type Client struct + func New(addr string, options ...Option) (*Client, error) + func (c *Client) Close() + func (c *Client) ParseDefiniteMessage(msg amqp.Delivery) (dm DefiniteMessage, ok bool) + func (c *Client) Publish(exchange, routeKey string, opts ...PublishOption) (err error) + func (c *Client) PublishDefinite(exchange, routeKey string, opts ...PublishOption) (err error) + func (c *Client) SetConsumer(consumer func(c *Client, msg amqp.Delivery)) + type Config struct + Addr string + Amqp amqp.Config + Confirm confirm + ConsumeInOrder bool + Consumer func(c *Client, msg amqp.Delivery) + ConsumerTag string + Exchanges []*exchange + Password string + PrefetchCount int + Queue *queue + QueueDisable bool + Recovery recovery + Username string + func NewConfig() *Config + type DefiniteMessage struct + Exchange string + From string + Id string + type ExchangeOption func(ex *exchange) + func ExchangeArgs(args amqp.Table) ExchangeOption + func ExchangeAutoDelete() ExchangeOption + func ExchangeDurable() ExchangeOption + func ExchangeInternal() ExchangeOption + func ExchangeNoWait() ExchangeOption + type Option func(cfg *Config) + func AmqpConfig(config amqp.Config) Option + func Auth(username, password string) Option + func Confirm(chSize int, timeout time.Duration, noWait bool) Option + func ConsumeInOrder() Option + func Consumer(consumer func(c *Client, msg amqp.Delivery)) Option + func ConsumerTag(consumerTag string) Option + func Debug() Option + func DefaultConsumer() Option + func Exchange(name string, kind kind, opts ...ExchangeOption) Option + func Heartbeat(ht time.Duration) Option + func PrefetchCount(count int) Option + func Queue(name, routeKey string, opts ...QueueOption) Option + func QueueDisable() Option + func Recovery(retryInterval time.Duration) Option + func Tls(tls *tls.Config) Option + func TlsCert(caFile, certFile, keyFile, keyFilePassword string) Option + func VHost(vh string) Option + type PublishOption func(pub *amqp.Publishing) + func PublishAppId(appId string) PublishOption + func PublishBody(body []byte) PublishOption + func PublishContentEncoding(contentEncoding string) PublishOption + func PublishContentType(contentType string) PublishOption + func PublishCorrelationId(correlationId string) PublishOption + func PublishDeliveryMode(deliveryMode uint8) PublishOption + func PublishExpiration(expire string) PublishOption + func PublishHeaders(keyPairs ...interface{}) PublishOption + func PublishMessageId(messageId string) PublishOption + func PublishPriority(priority uint8) PublishOption + func PublishReplyTo(replyTo string) PublishOption + func PublishTimestamp(timestamp time.Time) PublishOption + func PublishType(typ string) PublishOption + func PublishUserId(userId string) PublishOption + type QueueOption func(queue *queue) + func QueueArgs(args amqp.Table) QueueOption + func QueueAutoDelete() QueueOption + func QueueConsumeAutoAck() QueueOption + func QueueDurable() QueueOption + func QueueExclusive() QueueOption + func QueueNoWait() QueueOption