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 }