pkg

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AmqpChannel

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

func NewAmqpChannel

func NewAmqpChannel(amqpConnection *AmqpConnection) *AmqpChannel

func (*AmqpChannel) AddConsumer

func (c *AmqpChannel) AddConsumer(queueName string, consumerName string, prefetch int) chan amqp.Delivery

func (*AmqpChannel) Bind

func (c *AmqpChannel) Bind(queueName string, routingKey string, exchangeName string) error

Bind 绑定queue至exchange

func (*AmqpChannel) DeclareExchange

func (c *AmqpChannel) DeclareExchange(exchangeName, kind string, durable, autoDelete bool) error

DeclareExchange 创建Exchange kind direct fanout topic headers

func (*AmqpChannel) DeclareQueue

func (c *AmqpChannel) DeclareQueue(queueName string, durable bool, autoDelete bool) (string, error)

DeclareQueue 创建队列

func (*AmqpChannel) DeleteExchange

func (c *AmqpChannel) DeleteExchange(exchangeName string, ifUnused bool) error

DeleteExchange 删除Exchange

func (*AmqpChannel) DeleteQueue

func (c *AmqpChannel) DeleteQueue(queueName string, ifUnused bool, ifEmpty bool) error

DeleteQueue 删除队列

func (*AmqpChannel) Disconnect

func (c *AmqpChannel) Disconnect()

func (*AmqpChannel) RemoveConsumer

func (c *AmqpChannel) RemoveConsumer(consumerName string)

func (*AmqpChannel) SendToExchange

func (c *AmqpChannel) SendToExchange(exchangeName string, routingKey string, body string) error

SendToExchange 发送数据至指定交换机

func (*AmqpChannel) SendToExchangeWithType

func (c *AmqpChannel) SendToExchangeWithType(exchangeName string, routingKey string, body string, contentType string) error

SendToExchangeWithType 发送数据至指定交换机

func (*AmqpChannel) SendToQueue

func (c *AmqpChannel) SendToQueue(queueName string, body string) error

SendToQueue 发送数据至指定队列

func (*AmqpChannel) SendToQueueWithType

func (c *AmqpChannel) SendToQueueWithType(queueName string, body string, contentType string) error

SendToQueueWithType 发送数据至指定队列

func (*AmqpChannel) Unbind

func (c *AmqpChannel) Unbind(queueName string, routingKey string, exchangeName string) error

Unbind 解绑queue与exchange

type AmqpConnectOption

type AmqpConnectOption struct {
	Host     string
	Port     int
	Vhost    string
	Username string
	Password string
}

type AmqpConnection

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

func NewAmqpConnection

func NewAmqpConnection(option AmqpConnectOption, logID string) *AmqpConnection

func (*AmqpConnection) Disconnect

func (c *AmqpConnection) Disconnect()

Jump to

Keyboard shortcuts

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