This commit is contained in:
crusader 2018-04-12 15:07:36 +09:00
parent 3525f1d3c2
commit bb624f146f
3 changed files with 38 additions and 0 deletions

6
config/probe/account.go Normal file
View File

@ -0,0 +1,6 @@
package probe
type Account struct {
Name string `json:"name"`
APIKey string `json:"apiKey"`
}

26
config/probe/auth/auth.go Normal file
View File

@ -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
}

6
config/probe/central.go Normal file
View File

@ -0,0 +1,6 @@
package probe
type Central struct {
Host string `json:"host"`
Port int `json:"port"`
}