Documentation
¶
Index ¶
- type RabbitProduct
- func (p *RabbitProduct) Close() error
- func (p *RabbitProduct) Conn(addr string, ttl int) (bool, error)
- func (p *RabbitProduct) DeleteExchange(usePrefix bool, exchangeName string, use bool, empty bool) error
- func (p *RabbitProduct) DeleteQueue(usePrefix bool, queueName string, use bool, empty bool) (int, error)
- func (p *RabbitProduct) GetBool(sign int) bool
- func (p *RabbitProduct) GetTtl() int
- func (p *RabbitProduct) GetType(tTag string) string
- func (p *RabbitProduct) InitDefdelay(usePreFix bool) (bool, error)
- func (p *RabbitProduct) PubMessage(usePreFix bool, eType string, queue string, exchange string, route string, ...) (bool, error)
- func (p *RabbitProduct) QueueDeclareDelay(queue string, durable bool, auto_delete bool, ttl int) error
- func (p *RabbitProduct) QueueSimple(queue string, msg string, durable bool, autoDelete bool) (bool, error)
- func (p *RabbitProduct) QueueUnbind(usePrefix bool, name string, route string, exchange string) error
- func (p *RabbitProduct) RegisterDelay(delayQueue string, delayExchange string, routeKey string) (bool, error)
- func (p *RabbitProduct) RegisterDelayWithPreFix(delayQueue string, delayExchange string, routeKey string) (bool, error)
- func (p *RabbitProduct) SetTtl(ttl int)
- func (p *RabbitProduct) UnsafePush(exchange string, routeKey string, data string) error
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) 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
Click to show internal directories.
Click to hide internal directories.