rabbit

package
v0.0.0-...-183cb28 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 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 RabbitProduct

type RabbitProduct struct {
	Addr       string
	Connection *amqp.Connection
	Channel    *amqp.Channel
	Ttl        int

	DelayExchange string
	DelayQueue    string
	DelayRoute    string
	PreFix        string
	Sep           string
	// contains filtered or unexported fields
}
var (
	Rabbit *RabbitProduct
)

func NewRabbitProduct

func NewRabbitProduct(addr string, ttl int, prefix string, sep string, delayExchange string, delayQueue string, delayRoute string) *RabbitProduct

实体

func (*RabbitProduct) Close

func (p *RabbitProduct) Close() error

关闭连接

func (*RabbitProduct) Conn

func (p *RabbitProduct) Conn(addr string, ttl int) (bool, error)

func (*RabbitProduct) DeleteExchange

func (p *RabbitProduct) DeleteExchange(usePrefix bool, exchangeName string, use bool, empty bool) error

删除交换机(暂时不提供)

func (*RabbitProduct) DeleteQueue

func (p *RabbitProduct) DeleteQueue(usePrefix bool, queueName string, use bool, empty bool) (int, error)

删除队列

func (*RabbitProduct) GetBool

func (p *RabbitProduct) GetBool(sign int) bool

func (*RabbitProduct) GetTtl

func (p *RabbitProduct) GetTtl() int

func (*RabbitProduct) GetType

func (p *RabbitProduct) GetType(tTag string) string

func (*RabbitProduct) InitDefdelay

func (p *RabbitProduct) InitDefdelay(usePreFix bool) (bool, error)

默认回收队列注册

func (*RabbitProduct) PubMessage

func (p *RabbitProduct) PubMessage(usePreFix bool, eType string, queue string, exchange string, route string, msg string, durable bool, autoDelete bool, ttl int) (bool, error)

推送消息

func (*RabbitProduct) QueueDeclareDelay

func (p *RabbitProduct) QueueDeclareDelay(queue string, durable bool, auto_delete bool, ttl int) error

设置队列回收

func (*RabbitProduct) QueueSimple

func (p *RabbitProduct) QueueSimple(queue string, msg string, durable bool, autoDelete bool) (bool, error)

*

QueueSimple Queue push
TODO :: Test

func (*RabbitProduct) QueueUnbind

func (p *RabbitProduct) QueueUnbind(usePrefix bool, name string, route string, exchange string) error

解绑

func (*RabbitProduct) RegisterDelay

func (p *RabbitProduct) RegisterDelay(delayQueue string, delayExchange string, routeKey string) (bool, error)

回收队列注册

func (*RabbitProduct) RegisterDelayWithPreFix

func (p *RabbitProduct) RegisterDelayWithPreFix(delayQueue string, delayExchange string, routeKey string) (bool, error)

外部调用

func (*RabbitProduct) SetTtl

func (p *RabbitProduct) SetTtl(ttl int)

func (*RabbitProduct) UnsafePush

func (p *RabbitProduct) UnsafePush(exchange string, routeKey string, data string) error

Push

Jump to

Keyboard shortcuts

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