rabbitmq

package
v0.0.0-...-3ada85e Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

* * @Author: myxy99 <myxy99@foxmail.com> * @Date: 2020/7/31 9:49

* * @Author: myxy99 <myxy99@foxmail.com> * @Date: 2020/7/31 9:49

Index

Constants

This section is empty.

Variables

View Source
var DefaultInvokerCfg = InvokerCfg{
	Host: "",
}

* type:

simple
pubSub
routing
topic

Functions

func DefaultBuild

func DefaultBuild() module.Invoker

default invoker build

Types

type Client

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

func Invoker

func Invoker(name string) *Client

invoker

func (*Client) NewRabbitMQ

func (c *Client) NewRabbitMQ(typeMq string, names ...string) RabbitImp

type InvokerCfg

type InvokerCfg struct {
	Host string `ini:"host"`
}

type PubSub

type PubSub struct {
	*RabbitMQ
}

func (*PubSub) Destroy

func (r *PubSub) Destroy()

func (*PubSub) Publish

func (r *PubSub) Publish(message string) (err error)

func (*PubSub) Receive

func (r *PubSub) Receive(f func(amqp.Delivery))

type RabbitImp

type RabbitImp interface {
	Publish(string) error
	Receive(func(amqp.Delivery))
	Destroy()
}

type RabbitMQ

type RabbitMQ struct {

	//队列名称
	QueueName string
	//交换机名称
	Exchange string
	//bind Key 名称
	Key string
	//连接信息
	Mqurl string
	// contains filtered or unexported fields
}

type Routing

type Routing struct {
	*RabbitMQ
}

func (*Routing) Destroy

func (r *Routing) Destroy()

func (*Routing) Publish

func (r *Routing) Publish(message string) (err error)

func (*Routing) Receive

func (r *Routing) Receive(f func(amqp.Delivery))

type Simple

type Simple struct {
	*RabbitMQ
}

func (*Simple) Destroy

func (r *Simple) Destroy()

func (*Simple) Publish

func (r *Simple) Publish(message string) (err error)

func (*Simple) Receive

func (r *Simple) Receive(f func(amqp.Delivery))

type Topic

type Topic struct {
	*RabbitMQ
}

func (*Topic) Destroy

func (r *Topic) Destroy()

func (*Topic) Publish

func (r *Topic) Publish(message string) (err error)

func (*Topic) Receive

func (r *Topic) Receive(f func(amqp.Delivery))

Jump to

Keyboard shortcuts

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