1 Star 0 Fork 0

eden-framework / eden-framework

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
drone_ci_kind__generated.go 2.27 KB
一键复制 编辑 原始数据 按行查看 历史
文兄 提交于 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 InvalidDroneCiKind = errors.New("invalid DroneCiKind")
func init() {
github_com_eden_framework_enumeration.RegisterEnums("DroneCiKind", map[string]string{
"secret": "secret",
"signature": "signature",
"pipeline": "pipeline",
})
}
func ParseDroneCiKindFromString(s string) (DroneCiKind, error) {
switch s {
case "":
return DRONE_CI_KIND_UNKNOWN, nil
case "secret":
return DRONE_CI_KIND__secret, nil
case "signature":
return DRONE_CI_KIND__signature, nil
case "pipeline":
return DRONE_CI_KIND__pipeline, nil
}
return DRONE_CI_KIND_UNKNOWN, InvalidDroneCiKind
}
func ParseDroneCiKindFromLabelString(s string) (DroneCiKind, error) {
switch s {
case "":
return DRONE_CI_KIND_UNKNOWN, nil
case "secret":
return DRONE_CI_KIND__secret, nil
case "signature":
return DRONE_CI_KIND__signature, nil
case "pipeline":
return DRONE_CI_KIND__pipeline, nil
}
return DRONE_CI_KIND_UNKNOWN, InvalidDroneCiKind
}
func (DroneCiKind) EnumType() string {
return "DroneCiKind"
}
func (DroneCiKind) Enums() map[int][]string {
return map[int][]string{
int(DRONE_CI_KIND__secret): {"secret", "secret"},
int(DRONE_CI_KIND__signature): {"signature", "signature"},
int(DRONE_CI_KIND__pipeline): {"pipeline", "pipeline"},
}
}
func (v DroneCiKind) String() string {
switch v {
case DRONE_CI_KIND_UNKNOWN:
return ""
case DRONE_CI_KIND__secret:
return "secret"
case DRONE_CI_KIND__signature:
return "signature"
case DRONE_CI_KIND__pipeline:
return "pipeline"
}
return "UNKNOWN"
}
func (v DroneCiKind) Label() string {
switch v {
case DRONE_CI_KIND_UNKNOWN:
return ""
case DRONE_CI_KIND__secret:
return "secret"
case DRONE_CI_KIND__signature:
return "signature"
case DRONE_CI_KIND__pipeline:
return "pipeline"
}
return "UNKNOWN"
}
var _ interface {
encoding.TextMarshaler
encoding.TextUnmarshaler
} = (*DroneCiKind)(nil)
func (v DroneCiKind) MarshalText() ([]byte, error) {
str := v.String()
if str == "UNKNOWN" {
return nil, InvalidDroneCiKind
}
return []byte(str), nil
}
func (v *DroneCiKind) UnmarshalText(data []byte) (err error) {
*v, err = ParseDroneCiKindFromString(string(bytes.ToUpper(data)))
return
}
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

搜索帮助