forked from grafana/k6
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexecution_status_gen.go
58 lines (48 loc) · 1.78 KB
/
execution_status_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
52
53
54
55
56
57
58
// Code generated by "enumer -type=ExecutionStatus -trimprefix ExecutionStatus -output execution_status_gen.go"; DO NOT EDIT.
//
package lib
import (
"fmt"
)
const _ExecutionStatusName = "CreatedInitVUsInitExecutorsInitDonePausedBeforeRunStartedSetupRunningTeardownEnded"
var _ExecutionStatusIndex = [...]uint8{0, 7, 14, 27, 35, 50, 57, 62, 69, 77, 82}
func (i ExecutionStatus) String() string {
if i >= ExecutionStatus(len(_ExecutionStatusIndex)-1) {
return fmt.Sprintf("ExecutionStatus(%d)", i)
}
return _ExecutionStatusName[_ExecutionStatusIndex[i]:_ExecutionStatusIndex[i+1]]
}
var _ExecutionStatusValues = []ExecutionStatus{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
var _ExecutionStatusNameToValueMap = map[string]ExecutionStatus{
_ExecutionStatusName[0:7]: 0,
_ExecutionStatusName[7:14]: 1,
_ExecutionStatusName[14:27]: 2,
_ExecutionStatusName[27:35]: 3,
_ExecutionStatusName[35:50]: 4,
_ExecutionStatusName[50:57]: 5,
_ExecutionStatusName[57:62]: 6,
_ExecutionStatusName[62:69]: 7,
_ExecutionStatusName[69:77]: 8,
_ExecutionStatusName[77:82]: 9,
}
// ExecutionStatusString retrieves an enum value from the enum constants string name.
// Throws an error if the param is not part of the enum.
func ExecutionStatusString(s string) (ExecutionStatus, error) {
if val, ok := _ExecutionStatusNameToValueMap[s]; ok {
return val, nil
}
return 0, fmt.Errorf("%s does not belong to ExecutionStatus values", s)
}
// ExecutionStatusValues returns all values of the enum
func ExecutionStatusValues() []ExecutionStatus {
return _ExecutionStatusValues
}
// IsAExecutionStatus returns "true" if the value is listed in the enum definition. "false" otherwise
func (i ExecutionStatus) IsAExecutionStatus() bool {
for _, v := range _ExecutionStatusValues {
if i == v {
return true
}
}
return false
}