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_failure__generated.go 1.88 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 InvalidDroneCiStepFailure = errors.New("invalid DroneCiStepFailure")
func init() {
github_com_eden_framework_enumeration.RegisterEnums("DroneCiStepFailure", map[string]string{
"ignore": "ignore",
})
}
func ParseDroneCiStepFailureFromString(s string) (DroneCiStepFailure, error) {
switch s {
case "":
return DRONE_CI_STEP_FAILURE_UNKNOWN, nil
case "ignore":
return DRONE_CI_STEP_FAILURE__ignore, nil
}
return DRONE_CI_STEP_FAILURE_UNKNOWN, InvalidDroneCiStepFailure
}
func ParseDroneCiStepFailureFromLabelString(s string) (DroneCiStepFailure, error) {
switch s {
case "":
return DRONE_CI_STEP_FAILURE_UNKNOWN, nil
case "ignore":
return DRONE_CI_STEP_FAILURE__ignore, nil
}
return DRONE_CI_STEP_FAILURE_UNKNOWN, InvalidDroneCiStepFailure
}
func (DroneCiStepFailure) EnumType() string {
return "DroneCiStepFailure"
}
func (DroneCiStepFailure) Enums() map[int][]string {
return map[int][]string{
int(DRONE_CI_STEP_FAILURE__ignore): {"ignore", "ignore"},
}
}
func (v DroneCiStepFailure) String() string {
switch v {
case DRONE_CI_STEP_FAILURE_UNKNOWN:
return ""
case DRONE_CI_STEP_FAILURE__ignore:
return "ignore"
}
return "UNKNOWN"
}
func (v DroneCiStepFailure) Label() string {
switch v {
case DRONE_CI_STEP_FAILURE_UNKNOWN:
return ""
case DRONE_CI_STEP_FAILURE__ignore:
return "ignore"
}
return "UNKNOWN"
}
var _ interface {
encoding.TextMarshaler
encoding.TextUnmarshaler
} = (*DroneCiStepFailure)(nil)
func (v DroneCiStepFailure) MarshalText() ([]byte, error) {
str := v.String()
if str == "UNKNOWN" {
return nil, InvalidDroneCiStepFailure
}
return []byte(str), nil
}
func (v *DroneCiStepFailure) UnmarshalText(data []byte) (err error) {
*v, err = ParseDroneCiStepFailureFromString(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
v1.4.7

Search