From b1143984f292d2d259a17391422f8713192e2bc2 Mon Sep 17 00:00:00 2001 From: crusader Date: Sat, 14 Apr 2018 17:56:30 +0900 Subject: [PATCH] ing --- core/config/proxy.go | 10 +++++----- external/config/external.go | 6 +++--- external/config/grpc.go | 4 ++-- external/config/kafka.go | 4 ++-- external/config/redis.go | 4 ++-- probe/config/account.go | 4 ++-- probe/config/central.go | 4 ++-- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/core/config/proxy.go b/core/config/proxy.go index 36b4516..634bae9 100644 --- a/core/config/proxy.go +++ b/core/config/proxy.go @@ -1,9 +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"` + Host string `json:"host,omitempty" yaml:"host" toml:"host"` + Port int `json:"port,omitempty" yaml:"port" toml:"port"` + UseAuth bool `default:"false" json:"useAuth,omitempty" yaml:"useAuth" toml:"useAuth"` + User string `json:"user,omitempty" yaml:"user" toml:"user"` + Password string `json:"password,omitempty" yaml:"password" toml:"password"` } diff --git a/external/config/external.go b/external/config/external.go index 5a45cfc..7e35f96 100644 --- a/external/config/external.go +++ b/external/config/external.go @@ -1,7 +1,7 @@ package config type External struct { - GRPC *GRPC `json:"grpc"` - Kafka *Kafka `json:"kafka"` - Redis *Redis `json:"redis"` + GRPC *GRPC `json:"grpc,omitempty"` + Kafka *Kafka `json:"kafka,omitempty"` + Redis *Redis `json:"redis,omitempty"` } diff --git a/external/config/grpc.go b/external/config/grpc.go index 6a79472..dd03615 100644 --- a/external/config/grpc.go +++ b/external/config/grpc.go @@ -1,6 +1,6 @@ package config type GRPC struct { - Network string `json:"network"` - Address string `json:"address"` + Network string `json:"network,omitempty"` + Address string `json:"address,omitempty"` } diff --git a/external/config/kafka.go b/external/config/kafka.go index c0ff218..6e7a698 100644 --- a/external/config/kafka.go +++ b/external/config/kafka.go @@ -1,6 +1,6 @@ package config type Kafka struct { - Network string `json:"network"` - Address string `json:"address"` + Network string `json:"network,omitempty"` + Address string `json:"address,omitempty"` } diff --git a/external/config/redis.go b/external/config/redis.go index e2c43e5..21eeb97 100644 --- a/external/config/redis.go +++ b/external/config/redis.go @@ -1,6 +1,6 @@ package config type Redis struct { - Network string `json:"network"` - Address string `json:"address"` + Network string `json:"network,omitempty"` + Address string `json:"address,omitempty"` } diff --git a/probe/config/account.go b/probe/config/account.go index a72a125..205649a 100644 --- a/probe/config/account.go +++ b/probe/config/account.go @@ -1,6 +1,6 @@ package config type Account struct { - Name string `required:"true" json:"name"` - APIKey string `required:"true" json:"apiKey"` + Name string `required:"true" json:"name,omitempty"` + APIKey string `required:"true" json:"apiKey,omitempty"` } diff --git a/probe/config/central.go b/probe/config/central.go index 87adb45..cfe6d2f 100644 --- a/probe/config/central.go +++ b/probe/config/central.go @@ -6,7 +6,7 @@ import ( ) type Central struct { - Address string `required:"address" json:"address"` + Address string `required:"true" json:"address"` Connector *csswc.Connectors `required:"true" json:"connector"` - Proxy *config.Proxy `json:"proxy"` + Proxy *config.Proxy `json:"proxy,omitempty"` }