-
Notifications
You must be signed in to change notification settings - Fork 0
/
drone_ci_platform_arch__generated.go
105 lines (92 loc) · 2.48 KB
/
drone_ci_platform_arch__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
package enums
import (
"bytes"
"encoding"
"errors"
github_com_eden_framework_enumeration "github.com/eden-framework/enumeration"
)
var InvalidDroneCiPlatformArch = errors.New("invalid DroneCiPlatformArch")
func init() {
github_com_eden_framework_enumeration.RegisterEnums("DroneCiPlatformArch", map[string]string{
"arm": "arm32",
"arm64": "arm64",
"amd64": "amd64",
})
}
func ParseDroneCiPlatformArchFromString(s string) (DroneCiPlatformArch, error) {
switch s {
case "":
return DRONE_CI_PLATFORM_ARCH_UNKNOWN, nil
case "arm":
return DRONE_CI_PLATFORM_ARCH__arm, nil
case "arm64":
return DRONE_CI_PLATFORM_ARCH__arm64, nil
case "amd64":
return DRONE_CI_PLATFORM_ARCH__amd64, nil
}
return DRONE_CI_PLATFORM_ARCH_UNKNOWN, InvalidDroneCiPlatformArch
}
func ParseDroneCiPlatformArchFromLabelString(s string) (DroneCiPlatformArch, error) {
switch s {
case "":
return DRONE_CI_PLATFORM_ARCH_UNKNOWN, nil
case "arm32":
return DRONE_CI_PLATFORM_ARCH__arm, nil
case "arm64":
return DRONE_CI_PLATFORM_ARCH__arm64, nil
case "amd64":
return DRONE_CI_PLATFORM_ARCH__amd64, nil
}
return DRONE_CI_PLATFORM_ARCH_UNKNOWN, InvalidDroneCiPlatformArch
}
func (DroneCiPlatformArch) EnumType() string {
return "DroneCiPlatformArch"
}
func (DroneCiPlatformArch) Enums() map[int][]string {
return map[int][]string{
int(DRONE_CI_PLATFORM_ARCH__arm): {"arm", "arm32"},
int(DRONE_CI_PLATFORM_ARCH__arm64): {"arm64", "arm64"},
int(DRONE_CI_PLATFORM_ARCH__amd64): {"amd64", "amd64"},
}
}
func (v DroneCiPlatformArch) String() string {
switch v {
case DRONE_CI_PLATFORM_ARCH_UNKNOWN:
return ""
case DRONE_CI_PLATFORM_ARCH__arm:
return "arm"
case DRONE_CI_PLATFORM_ARCH__arm64:
return "arm64"
case DRONE_CI_PLATFORM_ARCH__amd64:
return "amd64"
}
return "UNKNOWN"
}
func (v DroneCiPlatformArch) Label() string {
switch v {
case DRONE_CI_PLATFORM_ARCH_UNKNOWN:
return ""
case DRONE_CI_PLATFORM_ARCH__arm:
return "arm32"
case DRONE_CI_PLATFORM_ARCH__arm64:
return "arm64"
case DRONE_CI_PLATFORM_ARCH__amd64:
return "amd64"
}
return "UNKNOWN"
}
var _ interface {
encoding.TextMarshaler
encoding.TextUnmarshaler
} = (*DroneCiPlatformArch)(nil)
func (v DroneCiPlatformArch) MarshalText() ([]byte, error) {
str := v.String()
if str == "UNKNOWN" {
return nil, InvalidDroneCiPlatformArch
}
return []byte(str), nil
}
func (v *DroneCiPlatformArch) UnmarshalText(data []byte) (err error) {
*v, err = ParseDroneCiPlatformArchFromString(string(bytes.ToUpper(data)))
return
}