Documentation ¶
Index ¶
- Constants
- type AMQPObject
- func (q *AMQPObject) Close()
- func (q *AMQPObject) CreateExchange(ex exchangeObj) (rs error)
- func (q *AMQPObject) CreateQueue(qu queueObj) (*amqp.Queue, error)
- func (q *AMQPObject) DeleteQueue(queueName string) error
- func (q *AMQPObject) Listen(queueName string, routeKeys []string) (<-chan []byte, error)
- func (q *AMQPObject) Publish(exchangeName string, routeKeys []string, data []byte) error
- func (q *AMQPObject) Start() <-chan []byte
- func (q *AMQPObject) Subscribe(exchangeName, queueName string, routeKeys []string)
Constants ¶
View Source
const ( DefaultQueue = "system-queue" DefaultExchange = "system-exchange" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AMQPObject ¶
type AMQPObject struct {
// contains filtered or unexported fields
}
func Connection ¶
func Connection() (*AMQPObject, error)
func CreateConnect ¶
func CreateConnect(addr string) (*AMQPObject, error)
("amqp://%s:%s@%s:%v/", amqpConf.Username, amqpConf.Password, amqpConf.Addr, amqpConf.Port)
func (*AMQPObject) Close ¶
func (q *AMQPObject) Close()
func (*AMQPObject) CreateExchange ¶
func (q *AMQPObject) CreateExchange(ex exchangeObj) (rs error)
func (*AMQPObject) CreateQueue ¶
func (q *AMQPObject) CreateQueue(qu queueObj) (*amqp.Queue, error)
func (*AMQPObject) DeleteQueue ¶
func (q *AMQPObject) DeleteQueue(queueName string) error
func (*AMQPObject) Listen ¶
func (q *AMQPObject) Listen(queueName string, routeKeys []string) (<-chan []byte, error)
func (*AMQPObject) Publish ¶
func (q *AMQPObject) Publish(exchangeName string, routeKeys []string, data []byte) error
send data to broker with exchange name and route key list // input exchangeName with zero value to publish default exchange
func (*AMQPObject) Start ¶
func (q *AMQPObject) Start() <-chan []byte
consume with default exchange (topic type and community tags)
func (*AMQPObject) Subscribe ¶
func (q *AMQPObject) Subscribe(exchangeName, queueName string, routeKeys []string)
Binding queue to exchange with route key input exchangeName with zero value to subscribe default exchange
Click to show internal directories.
Click to hide internal directories.