-
Notifications
You must be signed in to change notification settings - Fork 57
/
enum_64_bit_enum.go
141 lines (128 loc) · 4.41 KB
/
enum_64_bit_enum.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
// Code generated by go-enum DO NOT EDIT.
// Version: example
// Revision: example
// Build Date: example
// Built By: example
//go:build example
// +build example
package example
import (
"fmt"
"strings"
)
const (
// Enum64bitUnkno is a Enum64bit of type Unkno.
Enum64bitUnkno Enum64bit = iota
// Enum64bitE2P15 is a Enum64bit of type E2P15.
Enum64bitE2P15 Enum64bit = iota + 32767
// Enum64bitE2P16 is a Enum64bit of type E2P16.
Enum64bitE2P16 Enum64bit = iota + 65534
// Enum64bitE2P17 is a Enum64bit of type E2P17.
Enum64bitE2P17 Enum64bit = iota + 131069
// Enum64bitE2P18 is a Enum64bit of type E2P18.
Enum64bitE2P18 Enum64bit = iota + 262140
// Enum64bitE2P19 is a Enum64bit of type E2P19.
Enum64bitE2P19 Enum64bit = iota + 524283
// Enum64bitE2P20 is a Enum64bit of type E2P20.
Enum64bitE2P20 Enum64bit = iota + 1048570
// Enum64bitE2P21 is a Enum64bit of type E2P21.
Enum64bitE2P21 Enum64bit = iota + 2097145
// Enum64bitE2P22 is a Enum64bit of type E2P22.
Enum64bitE2P22 Enum64bit = iota + 33554424
// Enum64bitE2P23 is a Enum64bit of type E2P23.
Enum64bitE2P23 Enum64bit = iota + 67108855
// Enum64bitE2P28 is a Enum64bit of type E2P28.
Enum64bitE2P28 Enum64bit = iota + 536870902
// Enum64bitE2P30 is a Enum64bit of type E2P30.
Enum64bitE2P30 Enum64bit = iota + 1073741813
// Enum64bitE2P31 is a Enum64bit of type E2P31.
Enum64bitE2P31 Enum64bit = iota + 2147483636
// Enum64bitE2P32 is a Enum64bit of type E2P32.
Enum64bitE2P32 Enum64bit = iota + 4294967283
// Enum64bitE2P33 is a Enum64bit of type E2P33.
Enum64bitE2P33 Enum64bit = iota + 8454967282
// Enum64bitE2P63 is a Enum64bit of type E2P63.
Enum64bitE2P63 Enum64bit = iota + 18446744073709551600
)
var ErrInvalidEnum64bit = fmt.Errorf("not a valid Enum64bit, try [%s]", strings.Join(_Enum64bitNames, ", "))
const _Enum64bitName = "UnknoE2P15E2P16E2P17E2P18E2P19E2P20E2P21E2P22E2P23E2P28E2P30E2P31E2P32E2P33E2P63"
var _Enum64bitNames = []string{
_Enum64bitName[0:5],
_Enum64bitName[5:10],
_Enum64bitName[10:15],
_Enum64bitName[15:20],
_Enum64bitName[20:25],
_Enum64bitName[25:30],
_Enum64bitName[30:35],
_Enum64bitName[35:40],
_Enum64bitName[40:45],
_Enum64bitName[45:50],
_Enum64bitName[50:55],
_Enum64bitName[55:60],
_Enum64bitName[60:65],
_Enum64bitName[65:70],
_Enum64bitName[70:75],
_Enum64bitName[75:80],
}
// Enum64bitNames returns a list of possible string values of Enum64bit.
func Enum64bitNames() []string {
tmp := make([]string, len(_Enum64bitNames))
copy(tmp, _Enum64bitNames)
return tmp
}
var _Enum64bitMap = map[Enum64bit]string{
Enum64bitUnkno: _Enum64bitName[0:5],
Enum64bitE2P15: _Enum64bitName[5:10],
Enum64bitE2P16: _Enum64bitName[10:15],
Enum64bitE2P17: _Enum64bitName[15:20],
Enum64bitE2P18: _Enum64bitName[20:25],
Enum64bitE2P19: _Enum64bitName[25:30],
Enum64bitE2P20: _Enum64bitName[30:35],
Enum64bitE2P21: _Enum64bitName[35:40],
Enum64bitE2P22: _Enum64bitName[40:45],
Enum64bitE2P23: _Enum64bitName[45:50],
Enum64bitE2P28: _Enum64bitName[50:55],
Enum64bitE2P30: _Enum64bitName[55:60],
Enum64bitE2P31: _Enum64bitName[60:65],
Enum64bitE2P32: _Enum64bitName[65:70],
Enum64bitE2P33: _Enum64bitName[70:75],
Enum64bitE2P63: _Enum64bitName[75:80],
}
// String implements the Stringer interface.
func (x Enum64bit) String() string {
if str, ok := _Enum64bitMap[x]; ok {
return str
}
return fmt.Sprintf("Enum64bit(%d)", x)
}
// IsValid provides a quick way to determine if the typed value is
// part of the allowed enumerated values
func (x Enum64bit) IsValid() bool {
_, ok := _Enum64bitMap[x]
return ok
}
var _Enum64bitValue = map[string]Enum64bit{
_Enum64bitName[0:5]: Enum64bitUnkno,
_Enum64bitName[5:10]: Enum64bitE2P15,
_Enum64bitName[10:15]: Enum64bitE2P16,
_Enum64bitName[15:20]: Enum64bitE2P17,
_Enum64bitName[20:25]: Enum64bitE2P18,
_Enum64bitName[25:30]: Enum64bitE2P19,
_Enum64bitName[30:35]: Enum64bitE2P20,
_Enum64bitName[35:40]: Enum64bitE2P21,
_Enum64bitName[40:45]: Enum64bitE2P22,
_Enum64bitName[45:50]: Enum64bitE2P23,
_Enum64bitName[50:55]: Enum64bitE2P28,
_Enum64bitName[55:60]: Enum64bitE2P30,
_Enum64bitName[60:65]: Enum64bitE2P31,
_Enum64bitName[65:70]: Enum64bitE2P32,
_Enum64bitName[70:75]: Enum64bitE2P33,
_Enum64bitName[75:80]: Enum64bitE2P63,
}
// ParseEnum64bit attempts to convert a string to a Enum64bit.
func ParseEnum64bit(name string) (Enum64bit, error) {
if x, ok := _Enum64bitValue[name]; ok {
return x, nil
}
return Enum64bit(0), fmt.Errorf("%s is %w", name, ErrInvalidEnum64bit)
}