Documentation ¶
Index ¶
- Constants
- type RabbitMQ
- func NewRabbitMQ(queuename string, exchange string, key string) *RabbitMQ
- func NewRabbitMQPubSub(exchangeName string) *RabbitMQ
- func NewRabbitMQRouting(exchagne string, routingKey string) *RabbitMQ
- func NewRabbitMQSimple(queueName string) *RabbitMQ
- func NewRabbitMQTopic(exchagne string, routingKey string) *RabbitMQ
- func (r *RabbitMQ) ConsumeSimple()
- func (r *RabbitMQ) Destory()
- func (r *RabbitMQ) PublishPub(message string)
- func (r *RabbitMQ) PublishRouting(message string)
- func (r *RabbitMQ) PublishSimple(message string)
- func (r *RabbitMQ) PublishTopic(message string)
- func (r *RabbitMQ) RecieveRouting()
- func (r *RabbitMQ) RecieveSub()
- func (r *RabbitMQ) RecieveTopic()
Constants ¶
View Source
const MQURL = "amqp://guest:guest@106.52.150.139:5672/"
const MQURL = "amqp://toor:root@106.52.150.139:5672/"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RabbitMQ ¶
type RabbitMQ struct { //队列名称 QueueName string //交换机 Exchange string //key Simple模式 几乎用不到 Key string //连接信息 Mqurl string // contains filtered or unexported fields }
func NewRabbitMQ ¶
创建RabbitMQ结构体实例
func NewRabbitMQRouting ¶
路由模式 创建RabbitMQ实例
func NewRabbitMQSimple ¶
简单模式step:1。创建简单模式下RabbitMQ实例
func NewRabbitMQTopic ¶
话题模式 创建RabbitMQ实例
func (*RabbitMQ) RecieveTopic ¶
func (r *RabbitMQ) RecieveTopic()
话题模式接收信息 要注意key 其中* 用于匹配一个单词,#用于匹配多个单词(可以是零个) 匹配 表示匹配imooc.* 表示匹配imooc.hello,但是imooc.hello.one需要用imooc.#才能匹配到
Click to show internal directories.
Click to hide internal directories.