From 354edcc78a19384a28dea7e8bd382c7c468363d1 Mon Sep 17 00:00:00 2001 From: crusader Date: Thu, 12 Apr 2018 15:11:54 +0900 Subject: [PATCH] ing --- config/probe/probe.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 config/probe/probe.go diff --git a/config/probe/probe.go b/config/probe/probe.go new file mode 100644 index 0000000..dd11d6b --- /dev/null +++ b/config/probe/probe.go @@ -0,0 +1,19 @@ +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 +}