commons-go/probe/config/probe.go
crusader 2ff8a44536 ing
2018-04-18 16:07:32 +09:00

20 lines
361 B
Go

package config
type ProbeStateType int
const (
ProbeStateTypeNotAuthorized ProbeStateType = iota
ProbeStateTypeAuthorized
)
type Probe struct {
Key *string `json:"key,omitempty" yaml:"key" toml:"key"`
}
func (c *Probe) State() ProbeStateType {
if nil != c.Key && "" != *c.Key {
return ProbeStateTypeAuthorized
}
return ProbeStateTypeNotAuthorized
}