commons-go/config/noauthprobe/auth.go
crusader 9f8fd87eca ing
2018-04-26 16:37:59 +09:00

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
}