Documentation
¶
Index ¶
- Constants
- Variables
- func Example_Ack(c *Client, topic, msgId, bindKey string)
- func Example_Consume(c *Client, topic, bindKey string)
- func Example_Dead_back(c *Client, topic string, num int)
- func Example_DelcareQueue(c *Client, topic, bindKey string)
- func Example_Loop_Consume(c *Client, topic, bindKey string)
- func Example_Produce(c *Client, topic string, num int, routeKey string)
- func Example_Publish(c *Client, channel, message string)
- func Example_Subscribe(c *Client, channel string)
- type Client
- func (c *Client) Ack(topic, msgId, bindKey string) error
- func (c *Client) Dead(topic, bindKey string) ([]byte, error)
- func (c *Client) Dead_back(topic string, num int) error
- func (c *Client) Declare(topic, bindKey string) ([]byte, error)
- func (c *Client) Exit()
- func (c *Client) GetAddr() string
- func (c *Client) Mpush(topic string, msgs []MMsgPkg, routeKey string) ([]uint64, error)
- func (c *Client) Ping() ([]byte, error)
- func (c *Client) Pop(topic, bindKey string) ([]byte, error)
- func (c *Client) Publish(channel, message string) error
- func (c *Client) Push(pkg MsgPkg) ([]byte, error)
- func (c *Client) Receive() (int, []byte)
- func (c *Client) Set(topic string, isAutoAck, mode, msgTTR, msgRetry int) ([]byte, error)
- func (c *Client) Subscribe(channel string) error
- type MMsgPkg
- type MsgPkg
- type RespMsgData
Constants ¶
View Source
const ( RESP_MESSAGE = 101 RESP_ERROR = 102 RESP_RESULT = 103 )
Variables ¶
View Source
var ( ErrTopicEmpty = errors.New("topic is empty") ErrTopicChannel = errors.New("channel is empty") )
Functions ¶
func Example_Loop_Consume ¶
轮询模式消费消息 当server端没有消息后,sleep 3秒后再次请求
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Mpush ¶
Mpush 批量生产消息 mpub <topic_name> <num> <msg.len> <[]byte({"delay":1,"body":"xxx","topic":"xxx","routeKey":"xxx"})> <msg.len> <[]byte({"delay":1,"body":"xxx","topic":"xxx","routeKey":"xxx"})>
func (*Client) Push ¶
Push 生产消息 pub <topic_name> <route_key> <delay-time> [ 4-byte size in bytes ][ N-byte binary data ]
type RespMsgData ¶
Click to show internal directories.
Click to hide internal directories.