rabbitMQ

package
v0.0.0-...-c6ee93b Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMQ

func NewMQ(queueName string)

func Produce

func Produce(ctx *gin.Context, msg string)

Types

type RabbitMQ

type RabbitMQ struct {

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

func GetRabbitMQ

func GetRabbitMQ() *RabbitMQ

func NewRabbitMQ

func NewRabbitMQ(queueName string, exchange string, key string) *RabbitMQ

NewRabbitMQ 创建结构体实例

func NewRabbitMQSimple

func NewRabbitMQSimple(queueName string) *RabbitMQ

NewRabbitMQSimple 创建简单模式下RabbitMQ实例

func (*RabbitMQ) ConsumeSimple

func (r *RabbitMQ) ConsumeSimple()

ConsumeSimple simple 模式下消费者

func (*RabbitMQ) Destroy

func (r *RabbitMQ) Destroy()

Destroy 断开channel和connection

func (*RabbitMQ) PublishSimple

func (r *RabbitMQ) PublishSimple(ctx *gin.Context, message string)

PublishSimple 直接模式队列生产

Jump to

Keyboard shortcuts

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