ing
This commit is contained in:
parent
3525f1d3c2
commit
bb624f146f
6
config/probe/account.go
Normal file
6
config/probe/account.go
Normal 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
26
config/probe/auth/auth.go
Normal 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
6
config/probe/central.go
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
package probe
|
||||||
|
|
||||||
|
type Central struct {
|
||||||
|
Host string `json:"host"`
|
||||||
|
Port int `json:"port"`
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user