-
Notifications
You must be signed in to change notification settings - Fork 0
/
drone_ci_type__generated.go
115 lines (102 loc) · 3.51 KB
/
drone_ci_type__generated.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
package enums
import (
"bytes"
"encoding"
"errors"
github_com_eden_framework_enumeration "github.com/eden-framework/enumeration"
)
var InvalidDroneCiType = errors.New("invalid DroneCiType")
func init() {
github_com_eden_framework_enumeration.RegisterEnums("DroneCiType", map[string]string{
"ssh": "which executes shell commands on remote servers using the ssh protocol",
"exec": "which executes pipeline steps directly on the host machine, with zero isolation",
"kubernetes": "which executes pipeline steps as containers inside of Kubernetes pods",
"docker": "which executes each pipeline steps inside isolated Docker containers",
})
}
func ParseDroneCiTypeFromString(s string) (DroneCiType, error) {
switch s {
case "":
return DRONE_CI_TYPE_UNKNOWN, nil
case "ssh":
return DRONE_CI_TYPE__ssh, nil
case "exec":
return DRONE_CI_TYPE__exec, nil
case "kubernetes":
return DRONE_CI_TYPE__kubernetes, nil
case "docker":
return DRONE_CI_TYPE__docker, nil
}
return DRONE_CI_TYPE_UNKNOWN, InvalidDroneCiType
}
func ParseDroneCiTypeFromLabelString(s string) (DroneCiType, error) {
switch s {
case "":
return DRONE_CI_TYPE_UNKNOWN, nil
case "which executes shell commands on remote servers using the ssh protocol":
return DRONE_CI_TYPE__ssh, nil
case "which executes pipeline steps directly on the host machine, with zero isolation":
return DRONE_CI_TYPE__exec, nil
case "which executes pipeline steps as containers inside of Kubernetes pods":
return DRONE_CI_TYPE__kubernetes, nil
case "which executes each pipeline steps inside isolated Docker containers":
return DRONE_CI_TYPE__docker, nil
}
return DRONE_CI_TYPE_UNKNOWN, InvalidDroneCiType
}
func (DroneCiType) EnumType() string {
return "DroneCiType"
}
func (DroneCiType) Enums() map[int][]string {
return map[int][]string{
int(DRONE_CI_TYPE__ssh): {"ssh", "which executes shell commands on remote servers using the ssh protocol"},
int(DRONE_CI_TYPE__exec): {"exec", "which executes pipeline steps directly on the host machine, with zero isolation"},
int(DRONE_CI_TYPE__kubernetes): {"kubernetes", "which executes pipeline steps as containers inside of Kubernetes pods"},
int(DRONE_CI_TYPE__docker): {"docker", "which executes each pipeline steps inside isolated Docker containers"},
}
}
func (v DroneCiType) String() string {
switch v {
case DRONE_CI_TYPE_UNKNOWN:
return ""
case DRONE_CI_TYPE__ssh:
return "ssh"
case DRONE_CI_TYPE__exec:
return "exec"
case DRONE_CI_TYPE__kubernetes:
return "kubernetes"
case DRONE_CI_TYPE__docker:
return "docker"
}
return "UNKNOWN"
}
func (v DroneCiType) Label() string {
switch v {
case DRONE_CI_TYPE_UNKNOWN:
return ""
case DRONE_CI_TYPE__ssh:
return "which executes shell commands on remote servers using the ssh protocol"
case DRONE_CI_TYPE__exec:
return "which executes pipeline steps directly on the host machine, with zero isolation"
case DRONE_CI_TYPE__kubernetes:
return "which executes pipeline steps as containers inside of Kubernetes pods"
case DRONE_CI_TYPE__docker:
return "which executes each pipeline steps inside isolated Docker containers"
}
return "UNKNOWN"
}
var _ interface {
encoding.TextMarshaler
encoding.TextUnmarshaler
} = (*DroneCiType)(nil)
func (v DroneCiType) MarshalText() ([]byte, error) {
str := v.String()
if str == "UNKNOWN" {
return nil, InvalidDroneCiType
}
return []byte(str), nil
}
func (v *DroneCiType) UnmarshalText(data []byte) (err error) {
*v, err = ParseDroneCiTypeFromString(string(bytes.ToUpper(data)))
return
}