rabbitmq

package
v1.6.4-0...-ea8c640 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigInfo

type ConfigInfo struct {
	Addr     string
	UserName string
	Password string
	Port     string
}

type MessageHandler

type MessageHandler struct {
	QueueName  string
	Exchange   string
	Key        string
	Handler    func(exchange string, body []byte)
	AutoDelete bool
	RetryCount int
}

type RabbitMQ

type RabbitMQ struct {
	Url        string
	Conn       *amqp.Connection
	Handlers   []*MessageHandler
	RetryCount int
}

func Default

func Default() (*RabbitMQ, error)

func (*RabbitMQ) Consume

func (mq *RabbitMQ) Consume(exchange, key string, handler func(exchange string, body []byte)) error

func (*RabbitMQ) ConsumeAutoDelete

func (mq *RabbitMQ) ConsumeAutoDelete(exchange, key string, handler func(exchange string, body []byte)) error

func (*RabbitMQ) SendMsg

func (mq *RabbitMQ) SendMsg(exchange, key, msg string)

Jump to

Keyboard shortcuts

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