commons-go/config/probe/probe.go
crusader 354edcc78a ing
2018-04-12 15:11:54 +09:00

20 lines
360 B
Go

package probe
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
}