27 lines
516 B
Go
27 lines
516 B
Go
package probe
|
|
|
|
import "time"
|
|
|
|
const (
|
|
AuthConfigFileName = "auth.json"
|
|
)
|
|
|
|
type AuthStateType int
|
|
|
|
const (
|
|
AuthStateTypeNotRegisterd AuthStateType = iota
|
|
AuthStateTypeRegisterd
|
|
)
|
|
|
|
type Auth struct {
|
|
TempKey *string `json:"tempKey,omitempty" yaml:"tempKey" toml:"tempKey"`
|
|
DenyDate *time.Time `json:"denyDate,omitempty" yaml:"denyDate" toml:"denyDate"`
|
|
}
|
|
|
|
func (a *Auth) State() AuthStateType {
|
|
if nil != a.TempKey && "" != *a.TempKey {
|
|
return AuthStateTypeRegisterd
|
|
}
|
|
return AuthStateTypeNotRegisterd
|
|
}
|