27 lines
516 B
Go
Raw Normal View History

2018-04-12 15:09:26 +09:00
package probe
2018-04-12 15:07:36 +09:00
import "time"
const (
2018-04-12 15:09:26 +09:00
AuthConfigFileName = "auth.json"
2018-04-12 15:07:36 +09:00
)
2018-04-12 15:09:26 +09:00
type AuthStateType int
2018-04-12 15:07:36 +09:00
const (
2018-04-12 15:09:26 +09:00
AuthStateTypeNotRegisterd AuthStateType = iota
AuthStateTypeRegisterd
2018-04-12 15:07:36 +09:00
)
type Auth struct {
TempKey *string `json:"tempKey,omitempty" yaml:"tempKey" toml:"tempKey"`
DenyDate *time.Time `json:"denyDate,omitempty" yaml:"denyDate" toml:"denyDate"`
}
2018-04-12 15:09:26 +09:00
func (a *Auth) State() AuthStateType {
2018-04-12 15:07:36 +09:00
if nil != a.TempKey && "" != *a.TempKey {
2018-04-12 15:09:26 +09:00
return AuthStateTypeRegisterd
2018-04-12 15:07:36 +09:00
}
2018-04-12 15:09:26 +09:00
return AuthStateTypeNotRegisterd
2018-04-12 15:07:36 +09:00
}