forked from grafana/k6
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompatibility_mode_gen.go
51 lines (41 loc) · 1.54 KB
/
compatibility_mode_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
48
49
50
51
// Code generated by "enumer -type=CompatibilityMode -transform=snake -trimprefix CompatibilityMode -output compatibility_mode_gen.go"; DO NOT EDIT.
package lib
import (
"fmt"
)
const _CompatibilityModeName = "extendedbaseexperimental_enhanced"
var _CompatibilityModeIndex = [...]uint8{0, 8, 12, 33}
func (i CompatibilityMode) String() string {
i -= 1
if i >= CompatibilityMode(len(_CompatibilityModeIndex)-1) {
return fmt.Sprintf("CompatibilityMode(%d)", i+1)
}
return _CompatibilityModeName[_CompatibilityModeIndex[i]:_CompatibilityModeIndex[i+1]]
}
var _CompatibilityModeValues = []CompatibilityMode{1, 2, 3}
var _CompatibilityModeNameToValueMap = map[string]CompatibilityMode{
_CompatibilityModeName[0:8]: 1,
_CompatibilityModeName[8:12]: 2,
_CompatibilityModeName[12:33]: 3,
}
// CompatibilityModeString retrieves an enum value from the enum constants string name.
// Throws an error if the param is not part of the enum.
func CompatibilityModeString(s string) (CompatibilityMode, error) {
if val, ok := _CompatibilityModeNameToValueMap[s]; ok {
return val, nil
}
return 0, fmt.Errorf("%s does not belong to CompatibilityMode values", s)
}
// CompatibilityModeValues returns all values of the enum
func CompatibilityModeValues() []CompatibilityMode {
return _CompatibilityModeValues
}
// IsACompatibilityMode returns "true" if the value is listed in the enum definition. "false" otherwise
func (i CompatibilityMode) IsACompatibilityMode() bool {
for _, v := range _CompatibilityModeValues {
if i == v {
return true
}
}
return false
}