23 lines
606 B
Go
23 lines
606 B
Go
package noauthprobe
|
|
|
|
import "git.loafle.net/overflow/overflow_commons_go/util"
|
|
|
|
type NoAuthProbeStateType int
|
|
|
|
const (
|
|
NoAuthProbeStateTypeNotRegisterd NoAuthProbeStateType = iota
|
|
NoAuthProbeStateTypeRegisterd
|
|
)
|
|
|
|
type NoAuthProbeConfig struct {
|
|
TempKey *string `json:"tempKey,omitempty" yaml:"tempKey" toml:"tempKey"`
|
|
DenyDate *util.Timestamp `json:"denyDate,omitempty" yaml:"denyDate" toml:"denyDate"`
|
|
}
|
|
|
|
func (c *NoAuthProbeConfig) State() NoAuthProbeStateType {
|
|
if nil != c.TempKey && "" != *c.TempKey {
|
|
return NoAuthProbeStateTypeRegisterd
|
|
}
|
|
return NoAuthProbeStateTypeNotRegisterd
|
|
}
|