From bb624f146f9d37cadb79bde4a8d76934231d0cdd Mon Sep 17 00:00:00 2001 From: crusader Date: Thu, 12 Apr 2018 15:07:36 +0900 Subject: [PATCH] ing --- config/probe/account.go | 6 ++++++ config/probe/auth/auth.go | 26 ++++++++++++++++++++++++++ config/probe/central.go | 6 ++++++ 3 files changed, 38 insertions(+) create mode 100644 config/probe/account.go create mode 100644 config/probe/auth/auth.go create mode 100644 config/probe/central.go diff --git a/config/probe/account.go b/config/probe/account.go new file mode 100644 index 0000000..767f487 --- /dev/null +++ b/config/probe/account.go @@ -0,0 +1,6 @@ +package probe + +type Account struct { + Name string `json:"name"` + APIKey string `json:"apiKey"` +} diff --git a/config/probe/auth/auth.go b/config/probe/auth/auth.go new file mode 100644 index 0000000..89128af --- /dev/null +++ b/config/probe/auth/auth.go @@ -0,0 +1,26 @@ +package auth + +import "time" + +const ( + ConfigFileName = "auth.json" +) + +type StateType int + +const ( + StateTypeNotRegisterd StateType = iota + StateTypeRegisterd +) + +type Auth struct { + TempKey *string `json:"tempKey,omitempty" yaml:"tempKey" toml:"tempKey"` + DenyDate *time.Time `json:"denyDate,omitempty" yaml:"denyDate" toml:"denyDate"` +} + +func (a *Auth) State() StateType { + if nil != a.TempKey && "" != *a.TempKey { + return StateTypeRegisterd + } + return StateTypeNotRegisterd +} diff --git a/config/probe/central.go b/config/probe/central.go new file mode 100644 index 0000000..76e1f56 --- /dev/null +++ b/config/probe/central.go @@ -0,0 +1,6 @@ +package probe + +type Central struct { + Host string `json:"host"` + Port int `json:"port"` +}