Documentation ¶
Overview ¶
Package rabbit contains an experimental RabbitMQ publishing client.
Index ¶
- Constants
- type Config
- type PublisherPool
- func (p *PublisherPool) Close(ctx context.Context) (err error)
- func (p *PublisherPool) Gauges(_ context.Context) map[string]float64
- func (p *PublisherPool) MetricName() string
- func (p *PublisherPool) Publish(ctx context.Context, msg publisher.Message) (err error)
- func (p *PublisherPool) PublishJSON(ctx context.Context, msg publisher.Message, v interface{}) (err error)
- func (p *PublisherPool) PublishJSONOptional(ctx context.Context, msg publisher.Message, v interface{}) (err error)
- func (p *PublisherPool) PublishOptional(ctx context.Context, msg publisher.Message) (err error)
Constants ¶
const JSON = "application/json; charset=utf-8"
JSON contains the MIME content type for a JSON payload.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PublisherPool ¶
type PublisherPool struct {
// contains filtered or unexported fields
}
func NewPublisherPool ¶
func (*PublisherPool) Close ¶
func (p *PublisherPool) Close(ctx context.Context) (err error)
Close frees the resources of the PublisherPool
func (*PublisherPool) Gauges ¶
func (p *PublisherPool) Gauges(_ context.Context) map[string]float64
Gauges returns internal measures of the health of the PublisherPool
func (*PublisherPool) MetricName ¶
func (p *PublisherPool) MetricName() string
MetricName returns the name of the PublisherPool
func (*PublisherPool) Publish ¶
Publish allows the publication of a message with mandatory routing. This should be your preferred option over PublishOptional
func (*PublisherPool) PublishJSON ¶
func (p *PublisherPool) PublishJSON(ctx context.Context, msg publisher.Message, v interface{}) (err error)
PublishJSON allows the publication of a JSON message with mandatory routing. This should be your preferred option over PublishJSONOptional
func (*PublisherPool) PublishJSONOptional ¶
func (p *PublisherPool) PublishJSONOptional(ctx context.Context, msg publisher.Message, v interface{}) (err error)
PublishJSONOptional allows the publication of a message without mandatory routing. This is useful when the message is not already being consumed. _You should prefer PublishJSON, which has mandatory routing forced, and should_ _move to mandatory routing once you confirm your message is indeed consumed._
func (*PublisherPool) PublishOptional ¶
PublishOptional allows the publication of a message without mandatory routing. This is useful when the message is not already being consumed. _You should prefer Publish, which has mandatory routing forced, and should_ _move to mandatory routing once you confirm your message is indeed consumed._