File: types.go

package info (click to toggle)
golang-github-denverdino-aliyungo 0.0~git20180921.13fa8aa-4
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,824 kB
  • sloc: xml: 1,359; makefile: 3
file content (49 lines) | stat: -rw-r--r-- 903 bytes parent folder | download | duplicates (3)
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
package mq

var newline string = "\n"

type SendMessage struct {
	Topic      string
	Tag        string
	ProducerId string
	Key        string
	Body       string
	Time       int64
}

type Messages struct {
	Topic      string
	Tag        string
	ConsumerId 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 "Bad Request"
	case 403:
		return "Authentication Failed"
	case 408:
		return "Request Timeout"
	default:
		return "Unknown Error"
	}
}