-
Notifications
You must be signed in to change notification settings - Fork 0
/
flowtype_gen.go
47 lines (37 loc) · 1.2 KB
/
flowtype_gen.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
// Code generated by "genenum.exe -typename=FlowType -packagename=flowtype -basedir=enum"
package flowtype
import "fmt"
type FlowType uint8
const (
Request FlowType = iota // Request for request packet (response packet expected)
Response // Response is reply of request packet
Notification // Notification is just send and forget packet
//
FlowType_Count int = iota
)
var _FlowType2string = [FlowType_Count][2]string{
Request: {"Request", "Request for request packet (response packet expected)"},
Response: {"Response", "Response is reply of request packet"},
Notification: {"Notification", "Notification is just send and forget packet"},
}
func (e FlowType) String() string {
if e >= 0 && e < FlowType(FlowType_Count) {
return _FlowType2string[e][0]
}
return fmt.Sprintf("FlowType%d", uint8(e))
}
func (e FlowType) CommentString() string {
if e >= 0 && e < FlowType(FlowType_Count) {
return _FlowType2string[e][1]
}
return ""
}
var _string2FlowType = map[string]FlowType{
"Request": Request,
"Response": Response,
"Notification": Notification,
}
func String2FlowType(s string) (FlowType, bool) {
v, b := _string2FlowType[s]
return v, b
}