commons-go/noauthprobe/config/auth.go
crusader 4ada7272de ing
2018-04-13 20:55:05 +09:00

29 lines
617 B
Go

package config
import "time"
const (
ConfigFileName = "auth.json"
)
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
}