Documentation
¶
Index ¶
- Constants
- func MakeParamStr(params interface{}) string
- func MakeSignPlainText(params interface{}, method string, host string, path string) string
- func Sign(signatureMethod string, secretKey string, data []byte) (signature string)
- type Account
- type Client
- type Params
- type Queue
- type QueueMessage
- type ReceiveMessage
- type ReceiveMessageParam
- type ReceiveMessageResp
- type SendMessageParam
- type SendMessageResp
Constants ¶
View Source
const ActionReceiveMessage = "ReceiveMessage"
View Source
const ActionSendMessage = "SendMessage"
View Source
const Path = "/v2/index.php"
PATH 接口路径
Variables ¶
This section is empty.
Functions ¶
func MakeSignPlainText ¶
MakeSignPlainText
Types ¶
type Account ¶
type Account struct {
// contains filtered or unexported fields
}
Account CMQ服务账号
func NewAccount ¶
NewAccount 创建Account实例
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client CMQ客户端
func (*Client) ReceiveMessage ¶
func (client *Client) ReceiveMessage(params interface{}) (ReceiveMessageResp, error)
ReceiveMessage 发送消息到队列
func (*Client) SendMessage ¶
func (client *Client) SendMessage(params interface{}) (SendMessageResp, error)
SendMessage 发送消息到队列
type Params ¶
type Params struct {
Action string `json:"action"`
Nonce int64 `json:"Nonce"`
RequestClient string `json:"RequestClient"`
SecretID string `json:"secretId"`
SignatureMethod string `json:"signatureMethod"`
Signature string `json:"signature"`
Timestamp int64 `json:"Timestamp"`
}
Params CMQ接口信息的数据结构
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
func (*Queue) ReceiveMessage ¶
func (queue *Queue) ReceiveMessage(pollingWaitSeconds int64) (ReceiveMessageResp, error)
ReceiveMessage 从队列消费消息
func (*Queue) SendMessage ¶
func (queue *Queue) SendMessage(msg interface{}, delay int64) (SendMessageResp, error)
SendMessage 发送信息到队列
type QueueMessage ¶
type ReceiveMessage ¶
type ReceiveMessageParam ¶
type ReceiveMessageParam struct {
Params
ReceiveMessage
}
type ReceiveMessageResp ¶
type ReceiveMessageResp struct {
SendMessageResp
MsgBody string `json:"msgBody"`
ReceiptHandle string `json:"receiptHandle"`
EnqueueTime int64 `json:"enqueueTime"`
FirstDequeueTime int64 `json:"firstDequeueTime"`
NextVisibleTime int64 `json:"nextVisibleTime"`
DequeueCount int64 `json:"dequeueCount"`
}
ReceiveMessageResp 接受消息返回的数据结构
type SendMessageParam ¶
type SendMessageParam struct {
Params
QueueMessage
}
Click to show internal directories.
Click to hide internal directories.