overflow_commons_go/config/probe/ProbeConfig.go
crusader fb2a8b7f18 ing
2017-12-01 21:54:27 +09:00

20 lines
372 B
Go

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
}