Fetch the repository succeeded.
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
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。