diff --git a/core/config/proxy.go b/core/config/proxy.go new file mode 100644 index 0000000..36b4516 --- /dev/null +++ b/core/config/proxy.go @@ -0,0 +1,9 @@ +package config + +type Proxy struct { + Host string `json:"host" yaml:"host" toml:"host"` + Port int `json:"port" yaml:"port" toml:"port"` + UseAuth bool `default:"false" json:"useAuth" yaml:"useAuth" toml:"useAuth"` + User string `json:"user" yaml:"user" toml:"user"` + Password string `json:"password" yaml:"password" toml:"password"` +} diff --git a/glide.yaml b/glide.yaml index 59fd733..1136dfb 100644 --- a/glide.yaml +++ b/glide.yaml @@ -2,3 +2,4 @@ package: git.loafle.net/overflow/commons-go import: - package: github.com/google/gopacket version: ^1.1.14 +- package: git.loafle.net/commons/server-go diff --git a/probe/config/account.go b/probe/config/account.go index 0db141c..a72a125 100644 --- a/probe/config/account.go +++ b/probe/config/account.go @@ -1,6 +1,6 @@ package config type Account struct { - Name string `json:"name"` - APIKey string `json:"apiKey"` + Name string `required:"true" json:"name"` + APIKey string `required:"true" json:"apiKey"` } diff --git a/probe/config/central.go b/probe/config/central.go index 07c7bb1..99514bb 100644 --- a/probe/config/central.go +++ b/probe/config/central.go @@ -1,6 +1,13 @@ package config +import ( + csswc "git.loafle.net/commons/server-go/socket/web/client" + "git.loafle.net/overflow/commons-go/core/config" +) + type Central struct { - Host string `json:"host"` - Port int `json:"port"` + Host string `required:"true" json:"host"` + Port int `required:"true" json:"port"` + Connector *csswc.Connectors `required:"true" json:"connector"` + Proxy *config.Proxy `json:"proxy"` }