rmq

package
v0.0.0-...-bff8ed8 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateChannel

func CreateChannel(v Channel) (err error)

创建信道

func CreateConnect

func CreateConnect(v Connect) (err error)

创建连接

func CreateExchange

func CreateExchange(v Exchange) (err error)

创建交换机

func CreatePoper

func CreatePoper(v Poper) (err error)

创建Poper

func CreatePusher

func CreatePusher(v Pusher) (err error)

创建Pusher

func CreateQueue

func CreateQueue(v Queue) (err error)

创建队列

func DeletePoper

func DeletePoper(name string) (err error)

删除Poper

func DeletePusher

func DeletePusher(name string) (err error)

删除Pusher

func Fini

func Fini() (err error)

关闭

func Init

func Init(path string) (err error)

初始化

func Pop

func Pop(name string, callback func(MSG)) (err error)

从队列获取消息 -- 推模式

func Push

func Push(name string, key string, msg []byte) (err error)

向交换机推送一条消息

Types

type Channel

type Channel struct {
	Name     string `json:Name`
	Connect  string `json:Connect`
	QosCount int    `json:QosCount`
	QosSize  int    `json:QosSize`
}

信道结构

type Connect

type Connect struct {
	Name string `json:Name`
	Addr string `json:Addr`
}

连接结构

type EBind

type EBind struct {
	Destination string `json:Destination`
	Key         string `json:Key`
	NoWait      bool   `json:NoWait`
}

交换机绑定结构

type Exchange

type Exchange struct {
	Name        string                 `json:Name`
	Channel     string                 `json:Channel`
	Type        string                 `json:Type`
	Durable     bool                   `json:Durable`
	AutoDeleted bool                   `json:AutoDeleted`
	Internal    bool                   `json:Internal`
	NoWait      bool                   `json:NoWait`
	Bind        []EBind                `json:Bind`
	Args        map[string]interface{} `json:Args`
}

交换机结构

type MSG

type MSG struct {
	Body    []byte
	Tag     uint64
	Channel string
	Poper   string
}

func (MSG) Ack

func (m MSG) Ack(multiple bool) (err error)

type Poper

type Poper struct {
	Name      string `json:Name`
	QName     string `json:QName`
	Channel   string `json:Channel`
	Consumer  string `json:Consumer`
	AutoACK   bool   `json:AutoACK`
	Exclusive bool   `json:Exclusive`
	NoLocal   bool   `json:NoLocal`
	NoWait    bool   `json:NoWait`
}

接收者配置

type Pusher

type Pusher struct {
	Name         string `json:Name`
	Channel      string `json:Channel`
	Exchange     string `json:Exchange`
	Key          string `json:Key`
	Mandtory     bool   `json:Mandtory`
	Immediate    bool   `json:Immediate`
	ContentType  string `json:ContentType`
	DeliveryMode uint8  `json:DeliveryMode`
}

发送者配置

type QBind

type QBind struct {
	ExchangeName string `json:ExchangeName`
	Key          string `json:Key`
	NoWait       bool   `json:NoWait`
}

队列绑定结构

type Queue

type Queue struct {
	Name       string                 `json:Name`
	Channel    string                 `json:Channel`
	Durable    bool                   `json:Durable`
	AutoDelete bool                   `json:AutoDelete`
	Exclusive  bool                   `json:Exclusive`
	NoWait     bool                   `json:NoWait`
	Bind       []QBind                `json:Bind`
	Args       map[string]interface{} `json:Args`
}

队列结构

Jump to

Keyboard shortcuts

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