Documentation ¶
Overview ¶
Copyright 2018 Andy Lo-A-Foe. All rights reserved. Use of this source code is governed by Apache-style license that can be found in the LICENSE file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AMQPConsumer ¶ added in v0.3.0
type AMQPConsumer struct {
// contains filtered or unexported fields
}
func NewConsumer ¶
func NewConsumer(config Config) (*AMQPConsumer, error)
func (*AMQPConsumer) Connect ¶ added in v0.3.0
func (c *AMQPConsumer) Connect() error
Connect to RabbitMQ server
func (*AMQPConsumer) Handle ¶ added in v0.3.0
func (c *AMQPConsumer) Handle( d <-chan amqp.Delivery, fn ConsumerHandlerFunc, threads int, queue string, routingKey string)
Handle has all the logic to make sure your program keeps running d should be a delievey channel as created when you call announceQueue fn should be a function that handles the processing of deliveries this should be the last thing called in main as code under it will become unreachable unless put int a goroutine. The q and rk params are redundent but allow you to have multiple queue listeners in main without them you would be tied into only using one queue per connection
func (*AMQPConsumer) Start ¶ added in v0.3.0
func (c *AMQPConsumer) Start() error
type AMQPProducer ¶ added in v0.3.0
type AMQPProducer struct {
// contains filtered or unexported fields
}
func NewProducer ¶
func NewProducer(config Config) (*AMQPProducer, error)
func (*AMQPProducer) Close ¶ added in v0.3.0
func (p *AMQPProducer) Close()
func (*AMQPProducer) Publish ¶ added in v0.3.0
func (p *AMQPProducer) Publish(exchange, routingKey string, msg amqp.Publishing) error