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"` +}