1 Star 0 Fork 0

eden-framework/eden-framework

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
drone_ci_step_pull__generated.go 2.48 KB
Copy Edit Raw Blame History
文兄 authored 2022-01-05 21:50 . change mod name
package enums
import (
"bytes"
"encoding"
"errors"
github_com_eden_framework_enumeration "gitee.com/eden-framework/enumeration"
)
var InvalidDroneCiStepPull = errors.New("invalid DroneCiStepPull")
func init() {
github_com_eden_framework_enumeration.RegisterEnums("DroneCiStepPull", map[string]string{
"never": "never",
"always": "always",
"if_not_exists": "if not exists",
})
}
func ParseDroneCiStepPullFromString(s string) (DroneCiStepPull, error) {
switch s {
case "":
return DRONE_CI_STEP_PULL_UNKNOWN, nil
case "never":
return DRONE_CI_STEP_PULL__never, nil
case "always":
return DRONE_CI_STEP_PULL__always, nil
case "if_not_exists":
return DRONE_CI_STEP_PULL__if_not_exists, nil
}
return DRONE_CI_STEP_PULL_UNKNOWN, InvalidDroneCiStepPull
}
func ParseDroneCiStepPullFromLabelString(s string) (DroneCiStepPull, error) {
switch s {
case "":
return DRONE_CI_STEP_PULL_UNKNOWN, nil
case "never":
return DRONE_CI_STEP_PULL__never, nil
case "always":
return DRONE_CI_STEP_PULL__always, nil
case "if not exists":
return DRONE_CI_STEP_PULL__if_not_exists, nil
}
return DRONE_CI_STEP_PULL_UNKNOWN, InvalidDroneCiStepPull
}
func (DroneCiStepPull) EnumType() string {
return "DroneCiStepPull"
}
func (DroneCiStepPull) Enums() map[int][]string {
return map[int][]string{
int(DRONE_CI_STEP_PULL__never): {"never", "never"},
int(DRONE_CI_STEP_PULL__always): {"always", "always"},
int(DRONE_CI_STEP_PULL__if_not_exists): {"if_not_exists", "if not exists"},
}
}
func (v DroneCiStepPull) String() string {
switch v {
case DRONE_CI_STEP_PULL_UNKNOWN:
return ""
case DRONE_CI_STEP_PULL__never:
return "never"
case DRONE_CI_STEP_PULL__always:
return "always"
case DRONE_CI_STEP_PULL__if_not_exists:
return "if_not_exists"
}
return "UNKNOWN"
}
func (v DroneCiStepPull) Label() string {
switch v {
case DRONE_CI_STEP_PULL_UNKNOWN:
return ""
case DRONE_CI_STEP_PULL__never:
return "never"
case DRONE_CI_STEP_PULL__always:
return "always"
case DRONE_CI_STEP_PULL__if_not_exists:
return "if not exists"
}
return "UNKNOWN"
}
var _ interface {
encoding.TextMarshaler
encoding.TextUnmarshaler
} = (*DroneCiStepPull)(nil)
func (v DroneCiStepPull) MarshalText() ([]byte, error) {
str := v.String()
if str == "UNKNOWN" {
return nil, InvalidDroneCiStepPull
}
return []byte(str), nil
}
func (v *DroneCiStepPull) UnmarshalText(data []byte) (err error) {
*v, err = ParseDroneCiStepPullFromString(string(bytes.ToUpper(data)))
return
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/eden-framework/eden-framework.git
git@gitee.com:eden-framework/eden-framework.git
eden-framework
eden-framework
eden-framework
v2.0.2

Search