forked from uber/tchannel-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
messagetype_string.go
55 lines (49 loc) · 1.61 KB
/
messagetype_string.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
// Code generated by "stringer -type=messageType"; DO NOT EDIT.
package tchannel
import "strconv"
func _() {
// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
var x [1]struct{}
_ = x[messageTypeInitReq-1]
_ = x[messageTypeInitRes-2]
_ = x[messageTypeCallReq-3]
_ = x[messageTypeCallRes-4]
_ = x[messageTypeCallReqContinue-19]
_ = x[messageTypeCallResContinue-20]
_ = x[messageTypeCancel-192]
_ = x[messageTypePingReq-208]
_ = x[messageTypePingRes-209]
_ = x[messageTypeError-255]
}
const (
_messageType_name_0 = "messageTypeInitReqmessageTypeInitResmessageTypeCallReqmessageTypeCallRes"
_messageType_name_1 = "messageTypeCallReqContinuemessageTypeCallResContinue"
_messageType_name_2 = "messageTypeCancel"
_messageType_name_3 = "messageTypePingReqmessageTypePingRes"
_messageType_name_4 = "messageTypeError"
)
var (
_messageType_index_0 = [...]uint8{0, 18, 36, 54, 72}
_messageType_index_1 = [...]uint8{0, 26, 52}
_messageType_index_3 = [...]uint8{0, 18, 36}
)
func (i messageType) String() string {
switch {
case 1 <= i && i <= 4:
i -= 1
return _messageType_name_0[_messageType_index_0[i]:_messageType_index_0[i+1]]
case 19 <= i && i <= 20:
i -= 19
return _messageType_name_1[_messageType_index_1[i]:_messageType_index_1[i+1]]
case i == 192:
return _messageType_name_2
case 208 <= i && i <= 209:
i -= 208
return _messageType_name_3[_messageType_index_3[i]:_messageType_index_3[i+1]]
case i == 255:
return _messageType_name_4
default:
return "messageType(" + strconv.FormatInt(int64(i), 10) + ")"
}
}