From fb2a8b7f187e6c23e2f0d251b78c15fb760ff534 Mon Sep 17 00:00:00 2001 From: crusader Date: Fri, 1 Dec 2017 21:54:27 +0900 Subject: [PATCH] ing --- config/probe/ProbeConfig.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 +}