Fetch the repository succeeded.
package enums
import (
"bytes"
"encoding"
"errors"
github_com_eden_framework_enumeration "gitee.com/eden-framework/enumeration"
)
var InvalidDroneCiTriggerEvent = errors.New("invalid DroneCiTriggerEvent")
func init() {
github_com_eden_framework_enumeration.RegisterEnums("DroneCiTriggerEvent", map[string]string{
"rollback": "rollback",
"promote": "promote",
"tag": "tag",
"pull_request": "pull request",
"push": "push",
"custom": "custom",
"cron": "cron",
})
}
func ParseDroneCiTriggerEventFromString(s string) (DroneCiTriggerEvent, error) {
switch s {
case "":
return DRONE_CI_TRIGGER_EVENT_UNKNOWN, nil
case "rollback":
return DRONE_CI_TRIGGER_EVENT__rollback, nil
case "promote":
return DRONE_CI_TRIGGER_EVENT__promote, nil
case "tag":
return DRONE_CI_TRIGGER_EVENT__tag, nil
case "pull_request":
return DRONE_CI_TRIGGER_EVENT__pull_request, nil
case "push":
return DRONE_CI_TRIGGER_EVENT__push, nil
case "custom":
return DRONE_CI_TRIGGER_EVENT__custom, nil
case "cron":
return DRONE_CI_TRIGGER_EVENT__cron, nil
}
return DRONE_CI_TRIGGER_EVENT_UNKNOWN, InvalidDroneCiTriggerEvent
}
func ParseDroneCiTriggerEventFromLabelString(s string) (DroneCiTriggerEvent, error) {
switch s {
case "":
return DRONE_CI_TRIGGER_EVENT_UNKNOWN, nil
case "rollback":
return DRONE_CI_TRIGGER_EVENT__rollback, nil
case "promote":
return DRONE_CI_TRIGGER_EVENT__promote, nil
case "tag":
return DRONE_CI_TRIGGER_EVENT__tag, nil
case "pull request":
return DRONE_CI_TRIGGER_EVENT__pull_request, nil
case "push":
return DRONE_CI_TRIGGER_EVENT__push, nil
case "custom":
return DRONE_CI_TRIGGER_EVENT__custom, nil
case "cron":
return DRONE_CI_TRIGGER_EVENT__cron, nil
}
return DRONE_CI_TRIGGER_EVENT_UNKNOWN, InvalidDroneCiTriggerEvent
}
func (DroneCiTriggerEvent) EnumType() string {
return "DroneCiTriggerEvent"
}
func (DroneCiTriggerEvent) Enums() map[int][]string {
return map[int][]string{
int(DRONE_CI_TRIGGER_EVENT__rollback): {"rollback", "rollback"},
int(DRONE_CI_TRIGGER_EVENT__promote): {"promote", "promote"},
int(DRONE_CI_TRIGGER_EVENT__tag): {"tag", "tag"},
int(DRONE_CI_TRIGGER_EVENT__pull_request): {"pull_request", "pull request"},
int(DRONE_CI_TRIGGER_EVENT__push): {"push", "push"},
int(DRONE_CI_TRIGGER_EVENT__custom): {"custom", "custom"},
int(DRONE_CI_TRIGGER_EVENT__cron): {"cron", "cron"},
}
}
func (v DroneCiTriggerEvent) String() string {
switch v {
case DRONE_CI_TRIGGER_EVENT_UNKNOWN:
return ""
case DRONE_CI_TRIGGER_EVENT__rollback:
return "rollback"
case DRONE_CI_TRIGGER_EVENT__promote:
return "promote"
case DRONE_CI_TRIGGER_EVENT__tag:
return "tag"
case DRONE_CI_TRIGGER_EVENT__pull_request:
return "pull_request"
case DRONE_CI_TRIGGER_EVENT__push:
return "push"
case DRONE_CI_TRIGGER_EVENT__custom:
return "custom"
case DRONE_CI_TRIGGER_EVENT__cron:
return "cron"
}
return "UNKNOWN"
}
func (v DroneCiTriggerEvent) Label() string {
switch v {
case DRONE_CI_TRIGGER_EVENT_UNKNOWN:
return ""
case DRONE_CI_TRIGGER_EVENT__rollback:
return "rollback"
case DRONE_CI_TRIGGER_EVENT__promote:
return "promote"
case DRONE_CI_TRIGGER_EVENT__tag:
return "tag"
case DRONE_CI_TRIGGER_EVENT__pull_request:
return "pull request"
case DRONE_CI_TRIGGER_EVENT__push:
return "push"
case DRONE_CI_TRIGGER_EVENT__custom:
return "custom"
case DRONE_CI_TRIGGER_EVENT__cron:
return "cron"
}
return "UNKNOWN"
}
var _ interface {
encoding.TextMarshaler
encoding.TextUnmarshaler
} = (*DroneCiTriggerEvent)(nil)
func (v DroneCiTriggerEvent) MarshalText() ([]byte, error) {
str := v.String()
if str == "UNKNOWN" {
return nil, InvalidDroneCiTriggerEvent
}
return []byte(str), nil
}
func (v *DroneCiTriggerEvent) UnmarshalText(data []byte) (err error) {
*v, err = ParseDroneCiTriggerEventFromString(string(bytes.ToUpper(data)))
return
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。