28cd64a0c2
This reverts commit 06a799f5a6
51 lines
1.3 KiB
Go
51 lines
1.3 KiB
Go
package meta
|
|
|
|
import (
|
|
"encoding/json"
|
|
|
|
"git.loafle.net/overflow/commons-go/core/util"
|
|
)
|
|
|
|
type MetaNoAuthProbeStatus struct {
|
|
ID json.Number `json:"id,Number,omitempty"`
|
|
Key string `json:"key,omitempty"`
|
|
Name string `json:"name,omitempty"`
|
|
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
|
}
|
|
|
|
type MetaNoAuthProbeStatusEnum int
|
|
|
|
const (
|
|
MetaNoAuthProbeStatusEnumACCEPT MetaNoAuthProbeStatusEnum = iota + 1
|
|
MetaNoAuthProbeStatusEnumDENY
|
|
MetaNoAuthProbeStatusEnumPROCESSING
|
|
)
|
|
|
|
var (
|
|
metaNoAuthProbeStatusEnumID = map[MetaNoAuthProbeStatusEnum]string{
|
|
MetaNoAuthProbeStatusEnumACCEPT: "ACCEPT",
|
|
MetaNoAuthProbeStatusEnumDENY: "DENY",
|
|
MetaNoAuthProbeStatusEnumPROCESSING: "PROCESSING",
|
|
}
|
|
|
|
metaNoAuthProbeStatusEnumKey = map[string]MetaNoAuthProbeStatusEnum{
|
|
"ACCEPT": MetaNoAuthProbeStatusEnumACCEPT,
|
|
"DENY": MetaNoAuthProbeStatusEnumDENY,
|
|
"PROCESSING": MetaNoAuthProbeStatusEnumPROCESSING,
|
|
}
|
|
)
|
|
|
|
func (e MetaNoAuthProbeStatusEnum) String() string {
|
|
return metaNoAuthProbeStatusEnumID[e]
|
|
}
|
|
|
|
func ToMetaNoAuthProbeStatusEnum(v *MetaNoAuthProbeStatus) MetaNoAuthProbeStatusEnum {
|
|
return metaNoAuthProbeStatusEnumKey[v.Key]
|
|
}
|
|
|
|
func ToMetaNoAuthProbeStatus(v MetaNoAuthProbeStatusEnum) *MetaNoAuthProbeStatus {
|
|
return &MetaNoAuthProbeStatus{
|
|
Key: metaNoAuthProbeStatusEnumID[v],
|
|
}
|
|
}
|