rabbitmq

package
v0.0.0-...-0b57644 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RabbitCluster

type RabbitCluster struct {

	//队列名称
	QueueName string
	//交换机
	Exchange string
	//KEY
	Key string
	//连接信息
	Mqurl string
	// contains filtered or unexported fields
}

RabbitCluster RabbitMQ集群

func NewRabbitMQSimple

func NewRabbitMQSimple(username, password, host, vhost, queueName string) (*RabbitCluster, error)

NewRabbitMQSimple 创建简单模式下的实例

func (*RabbitCluster) ConsumeSimple

func (r *RabbitCluster) ConsumeSimple() <-chan amqp.Delivery

ConsumeSimple 简单模式下消费消息

func (*RabbitCluster) Destory

func (r *RabbitCluster) Destory()

Destory 关闭连接和通道

func (*RabbitCluster) PublistSimple

func (r *RabbitCluster) PublistSimple(message []byte) error

PublistSimple 简单模式下发送消息

type RabbitMQConfig

type RabbitMQConfig struct {
	Host     string            `yaml:"host"`
	Username string            `yaml:"user"`
	Password string            `yaml:"pass"`
	VHost    map[string]string `yaml:"vhost"`
}

Jump to

Keyboard shortcuts

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