2017-12-01 09:44:28 +00:00
|
|
|
package probe
|
|
|
|
|
2017-12-01 12:54:27 +00:00
|
|
|
type ProbeStateType int
|
|
|
|
|
|
|
|
const (
|
|
|
|
ProbeStateTypeNotAuthorized ProbeStateType = iota
|
|
|
|
ProbeStateTypeAuthorized
|
|
|
|
)
|
|
|
|
|
2017-12-01 09:44:28 +00:00
|
|
|
type ProbeConfig struct {
|
|
|
|
Key *string `json:"key,omitempty" yaml:"key" toml:"key"`
|
|
|
|
}
|
2017-12-01 12:54:27 +00:00
|
|
|
|
|
|
|
func (c *ProbeConfig) State() ProbeStateType {
|
|
|
|
if nil != c.Key && "" != *c.Key {
|
|
|
|
return ProbeStateTypeAuthorized
|
|
|
|
}
|
|
|
|
return ProbeStateTypeNotAuthorized
|
|
|
|
}
|