commons-go/config/probe/auth/auth.go
crusader bb624f146f ing
2018-04-12 15:07:36 +09:00

27 lines
483 B
Go

package auth
import "time"
const (
ConfigFileName = "auth.json"
)
type StateType int
const (
StateTypeNotRegisterd StateType = iota
StateTypeRegisterd
)
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() StateType {
if nil != a.TempKey && "" != *a.TempKey {
return StateTypeRegisterd
}
return StateTypeNotRegisterd
}