commons-go/config/probe/auth.go
crusader eadd089426 ing
2018-04-12 15:09:26 +09:00

27 lines
516 B
Go

package probe
import "time"
const (
AuthConfigFileName = "auth.json"
)
type AuthStateType int
const (
AuthStateTypeNotRegisterd AuthStateType = iota
AuthStateTypeRegisterd
)
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() AuthStateType {
if nil != a.TempKey && "" != *a.TempKey {
return AuthStateTypeRegisterd
}
return AuthStateTypeNotRegisterd
}