amqp

package
v0.0.0-...-3773cab Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL