This commit is contained in:
crusader 2017-12-01 21:54:27 +09:00
parent 9aae5d8821
commit fb2a8b7f18

View File

@ -1,5 +1,19 @@
package probe
type ProbeStateType int
const (
ProbeStateTypeNotAuthorized ProbeStateType = iota
ProbeStateTypeAuthorized
)
type ProbeConfig struct {
Key *string `json:"key,omitempty" yaml:"key" toml:"key"`
}
func (c *ProbeConfig) State() ProbeStateType {
if nil != c.Key && "" != *c.Key {
return ProbeStateTypeAuthorized
}
return ProbeStateTypeNotAuthorized
}