overflow_commons_go/config/noauthprobe/NoAuthProbeConfig.go

23 lines
552 B
Go
Raw Normal View History

2017-12-01 18:44:28 +09:00
package noauthprobe
2017-12-01 18:31:54 +09:00
2017-12-01 21:25:57 +09:00
import "time"
2017-12-01 18:31:54 +09:00
2017-12-01 20:02:32 +09:00
type NoAuthProbeStateType int
2017-12-01 20:00:51 +09:00
const (
2017-12-01 20:02:32 +09:00
NoAuthProbeStateTypeNotRegisterd NoAuthProbeStateType = iota
NoAuthProbeStateTypeRegisterd
2017-12-01 20:00:51 +09:00
)
2017-12-01 18:31:54 +09:00
type NoAuthProbeConfig struct {
2017-12-01 21:25:57 +09:00
TempKey *string `json:"tempKey,omitempty" yaml:"tempKey" toml:"tempKey"`
DenyDate *time.Time `json:"denyDate,omitempty" yaml:"denyDate" toml:"denyDate"`
2017-12-01 18:31:54 +09:00
}
2017-12-01 20:00:51 +09:00
2017-12-01 20:02:32 +09:00
func (c *NoAuthProbeConfig) State() NoAuthProbeStateType {
2017-12-01 20:00:51 +09:00
if nil != c.TempKey && "" != *c.TempKey {
2017-12-01 20:02:32 +09:00
return NoAuthProbeStateTypeRegisterd
2017-12-01 20:00:51 +09:00
}
2017-12-01 20:02:32 +09:00
return NoAuthProbeStateTypeNotRegisterd
2017-12-01 20:00:51 +09:00
}