diff --git a/config/probe/ProbeConfig.go b/config/probe/ProbeConfig.go index 8f9b656..7315238 100644 --- a/config/probe/ProbeConfig.go +++ b/config/probe/ProbeConfig.go @@ -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 +}