rabbitmq

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Client = NewRabbitMQ(options)

Client 测试案例使用的客户端,请自定义

Functions

This section is empty.

Types

type Options

type Options struct {
	UserName string
	Password string
	Host     string
	Vhost    string
}

type RabbitMQ

type RabbitMQ struct {
	// contains filtered or unexported fields
}

RabbitMQ rabbitMQ结构体

func NewRabbitMQ

func NewRabbitMQ(options Options) *RabbitMQ

NewRabbitMQ 创建简单模式下RabbitMQ实例

func (*RabbitMQ) Close

func (r *RabbitMQ) Close() error

func (*RabbitMQ) CreateQueue

func (r *RabbitMQ) CreateQueue(ctx context.Context, key string) error

CreateQueue 创建队列

func (*RabbitMQ) DeclareConsume

func (r *RabbitMQ) DeclareConsume(key string) error

func (*RabbitMQ) Destroy

func (r *RabbitMQ) Destroy(ctx context.Context, key string) error

Destroy 断开channel 和 connection

func (*RabbitMQ) Pop

func (r *RabbitMQ) Pop(ctx context.Context, key string) <-chan string

Pop 消费队列

func (*RabbitMQ) Push

func (r *RabbitMQ) Push(ctx context.Context, key, data string) error

Jump to

Keyboard shortcuts

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