commons-go/config/noauthprobe/auth.go
crusader 24ca9c8d4b ing
2018-04-26 16:53:29 +09:00

27 lines
636 B
Go

package noauthprobe
import (
"git.loafle.net/overflow/commons-go/core/util"
)
type AuthStateType int
const (
AuthStateTypeNotRegisterd AuthStateType = iota
AuthStateTypeRegisterd
)
type Auth struct {
TempKey *string `json:"tempKey,omitempty" yaml:"tempKey" toml:"tempKey"`
AcceptedDate *util.Timestamp `json:"acceptedDate,omitempty" yaml:"acceptedDate" toml:"acceptedDate"`
DeniedDate *util.Timestamp `json:"deniedDate,omitempty" yaml:"deniedDate" toml:"deniedDate"`
}
func (a *Auth) State() AuthStateType {
if nil != a.TempKey && "" != *a.TempKey {
return AuthStateTypeRegisterd
}
return AuthStateTypeNotRegisterd
}