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"
}
}
|