-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathresulttype_enumer.go
55 lines (45 loc) · 1.42 KB
/
resulttype_enumer.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 "enumer -type ResultType -transform=snake"; DO NOT EDIT.
//
package spf
import (
"fmt"
)
const _ResultTypeName = "noneneutralpassfailsoftfailtemperrorpermerror"
var _ResultTypeIndex = [...]uint8{0, 4, 11, 15, 19, 27, 36, 45}
func (i ResultType) String() string {
if i < 0 || i >= ResultType(len(_ResultTypeIndex)-1) {
return fmt.Sprintf("ResultType(%d)", i)
}
return _ResultTypeName[_ResultTypeIndex[i]:_ResultTypeIndex[i+1]]
}
var _ResultTypeValues = []ResultType{0, 1, 2, 3, 4, 5, 6}
var _ResultTypeNameToValueMap = map[string]ResultType{
_ResultTypeName[0:4]: 0,
_ResultTypeName[4:11]: 1,
_ResultTypeName[11:15]: 2,
_ResultTypeName[15:19]: 3,
_ResultTypeName[19:27]: 4,
_ResultTypeName[27:36]: 5,
_ResultTypeName[36:45]: 6,
}
// ResultTypeString retrieves an enum value from the enum constants string name.
// Throws an error if the param is not part of the enum.
func ResultTypeString(s string) (ResultType, error) {
if val, ok := _ResultTypeNameToValueMap[s]; ok {
return val, nil
}
return 0, fmt.Errorf("%s does not belong to ResultType values", s)
}
// ResultTypeValues returns all values of the enum
func ResultTypeValues() []ResultType {
return _ResultTypeValues
}
// IsAResultType returns "true" if the value is listed in the enum definition. "false" otherwise
func (i ResultType) IsAResultType() bool {
for _, v := range _ResultTypeValues {
if i == v {
return true
}
}
return false
}