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