ing
This commit is contained in:
parent
bb624f146f
commit
eadd089426
|
@ -1,16 +1,16 @@
|
||||||
package auth
|
package probe
|
||||||
|
|
||||||
import "time"
|
import "time"
|
||||||
|
|
||||||
const (
|
const (
|
||||||
ConfigFileName = "auth.json"
|
AuthConfigFileName = "auth.json"
|
||||||
)
|
)
|
||||||
|
|
||||||
type StateType int
|
type AuthStateType int
|
||||||
|
|
||||||
const (
|
const (
|
||||||
StateTypeNotRegisterd StateType = iota
|
AuthStateTypeNotRegisterd AuthStateType = iota
|
||||||
StateTypeRegisterd
|
AuthStateTypeRegisterd
|
||||||
)
|
)
|
||||||
|
|
||||||
type Auth struct {
|
type Auth struct {
|
||||||
|
@ -18,9 +18,9 @@ type Auth struct {
|
||||||
DenyDate *time.Time `json:"denyDate,omitempty" yaml:"denyDate" toml:"denyDate"`
|
DenyDate *time.Time `json:"denyDate,omitempty" yaml:"denyDate" toml:"denyDate"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *Auth) State() StateType {
|
func (a *Auth) State() AuthStateType {
|
||||||
if nil != a.TempKey && "" != *a.TempKey {
|
if nil != a.TempKey && "" != *a.TempKey {
|
||||||
return StateTypeRegisterd
|
return AuthStateTypeRegisterd
|
||||||
}
|
}
|
||||||
return StateTypeNotRegisterd
|
return AuthStateTypeNotRegisterd
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user