2018-04-26 07:37:59 +00:00
|
|
|
package meta
|
2018-04-12 09:38:04 +00:00
|
|
|
|
2018-05-10 09:30:39 +00:00
|
|
|
import (
|
|
|
|
"encoding/json"
|
2018-06-12 09:18:11 +00:00
|
|
|
"git.loafle.net/overflow/commons-go/core/util"
|
2018-05-10 09:30:39 +00:00
|
|
|
)
|
2018-04-12 09:38:04 +00:00
|
|
|
|
|
|
|
type MetaNoAuthProbeStatus struct {
|
2018-06-12 09:18:11 +00:00
|
|
|
ID json.Number `json:"id,Number,omitempty"`
|
|
|
|
Key string `json:"key, omitempty"`
|
|
|
|
Name string `json:"name,omitempty"`
|
|
|
|
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
2018-04-12 09:38:04 +00:00
|
|
|
}
|
2018-05-10 09:30:39 +00:00
|
|
|
|
2018-06-12 09:18:11 +00:00
|
|
|
type NoAuthProbeStatusEnum int
|
2018-05-10 09:30:39 +00:00
|
|
|
|
|
|
|
const (
|
2018-06-12 09:18:11 +00:00
|
|
|
NoAuthProbeStatusEnumACCEPT NoAuthProbeStatusEnum = 1
|
|
|
|
NoAuthProbeStatusEnumDENY NoAuthProbeStatusEnum = 2
|
|
|
|
NoAuthProbeStatusEnumPROCESSING NoAuthProbeStatusEnum = 3
|
2018-05-10 09:30:39 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2018-06-12 09:18:11 +00:00
|
|
|
noAuthProbeStatusEnumID = map[NoAuthProbeStatusEnum]string{
|
|
|
|
NoAuthProbeStatusEnumACCEPT: "ACCEPT",
|
|
|
|
NoAuthProbeStatusEnumDENY: "DENY",
|
|
|
|
NoAuthProbeStatusEnumPROCESSING:"PROCESSING",
|
2018-05-10 09:30:39 +00:00
|
|
|
}
|
|
|
|
|
2018-06-12 09:18:11 +00:00
|
|
|
noAuthProbeStatusEnumKey = map[string]NoAuthProbeStatusEnum{
|
|
|
|
"ACCEPT": NoAuthProbeStatusEnumACCEPT,
|
|
|
|
"DENY": NoAuthProbeStatusEnumDENY,
|
|
|
|
"PROCESSING": NoAuthProbeStatusEnumPROCESSING,
|
2018-05-10 09:30:39 +00:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2018-06-12 09:18:11 +00:00
|
|
|
func ToNoAuthProbeStatusEnum(v *MetaNoAuthProbeStatus) NoAuthProbeStatusEnum {
|
|
|
|
return noAuthProbeStatusEnumKey[v.Key]
|
2018-05-10 09:30:39 +00:00
|
|
|
}
|
|
|
|
|
2018-06-12 09:18:11 +00:00
|
|
|
func ToMetaNoAuthProbeStatus(v NoAuthProbeStatusEnum) *MetaNoAuthProbeStatus {
|
|
|
|
return &MetaNoAuthProbeStatus{
|
|
|
|
Key: noAuthProbeStatusEnumID[v],
|
2018-05-10 09:30:39 +00:00
|
|
|
}
|
|
|
|
}
|