/
alimq.go
57 lines (51 loc) · 1.03 KB
/
alimq.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package alimq
var newline string = "\n"
var (
ACCESS_KEY string
SECRET_KEY string
URL_PREFIX string
)
type SendMessage struct {
Topic string
Tag string
ProducerId string
Key string
Body string
Time int64
}
type Messages struct {
Topic string
Tag string
ConsumerId string
// Key string
// Body string
Time int64
}
type Message struct {
Body string `json:"body"`
BornTime string `json:"bornTime"`
Key string `json:"key"`
MsgHandle string `json:"msgHandle"`
MsgId string `json:"msgId"`
ReconsumeTimes int `json:"reconsumeTimes"`
Tag string `json:"tag"`
}
// 生产者状态码
func getStatusCodeMessage(statusCode int) string {
switch statusCode {
case 200:
return ""
case 201:
return ""
case 204:
return ""
case 400:
return "请求失败"
case 403:
return "鉴权失败"
case 408:
return "请求超时"
default:
return "未知错误"
}
}