25 lines
581 B
Go
25 lines
581 B
Go
package noauthprobe
|
|
|
|
import "time"
|
|
|
|
type AuthStateType int
|
|
|
|
const (
|
|
AuthStateTypeNotRegisterd AuthStateType = iota
|
|
AuthStateTypeRegisterd
|
|
)
|
|
|
|
type Auth struct {
|
|
TempKey *string `json:"tempKey,omitempty" yaml:"tempKey" toml:"tempKey"`
|
|
|
|
AcceptedDate *time.Time `json:"acceptedDate,omitempty" yaml:"acceptedDate" toml:"acceptedDate"`
|
|
DeniedDate *time.Time `json:"deniedDate,omitempty" yaml:"deniedDate" toml:"deniedDate"`
|
|
}
|
|
|
|
func (a *Auth) State() AuthStateType {
|
|
if nil != a.TempKey && "" != *a.TempKey {
|
|
return AuthStateTypeRegisterd
|
|
}
|
|
return AuthStateTypeNotRegisterd
|
|
}
|