diff --git a/api/config.go b/api/config.go index e5322ae..2c32dc5 100644 --- a/api/config.go +++ b/api/config.go @@ -10,25 +10,25 @@ import ( type ConfigTags map[string]interface{} // ConfigValues value for env -type KV struct { - Name string `json:"name,omitempty"` - Value interface{} `json:"value,omitempty"` +type ConfigVar struct { + Name string `json:"name"` + Value interface{} `json:"value"` } type ConfigValue struct { Ptype string `json:"ptype,omitempty"` Group string `json:"group,omitempty"` - KV + ConfigVar } type PtypeValue struct { - Env []KV `json:"env,omitempty"` - Ref []string `json:"ref,omitempty"` + Env []ConfigVar `json:"env,omitempty"` + Ref []string `json:"ref,omitempty"` } type ConfigInfo struct { - Ptype map[string]PtypeValue `json:"ptype,omitempty"` - Group map[string][]KV `json:"group,omitempty"` + Ptype map[string]PtypeValue `json:"ptype,omitempty"` + Group map[string][]ConfigVar `json:"group,omitempty"` } // ValuesRefs is the key, value for refs diff --git a/config/config_test.go b/config/config_test.go index 62155b0..cb30494 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -212,14 +212,14 @@ func TestConfigSet(t *testing.T) { Values: []api.ConfigValue{ { Group: "global", - KV: api.KV{ + ConfigVar: api.ConfigVar{ Name: "NEW_URL2", Value: "http://localhost:8080/", }, }, { Ptype: "web", - KV: api.KV{ + ConfigVar: api.ConfigVar{ Name: "NEW_URL", Value: "http://localhost:8080", }, @@ -247,14 +247,14 @@ func TestConfigSet(t *testing.T) { Values: []api.ConfigValue{ { Group: "global", - KV: api.KV{ + ConfigVar: api.ConfigVar{ Name: "NEW_URL2", Value: "http://localhost:8080/", }, }, { Ptype: "web", - KV: api.KV{ + ConfigVar: api.ConfigVar{ Name: "NEW_URL", Value: "http://localhost:8080", }, @@ -314,7 +314,7 @@ func TestConfigUnset(t *testing.T) { Values: []api.ConfigValue{ { Group: "global", - KV: api.KV{ + ConfigVar: api.ConfigVar{ Name: "TEST", Value: "", }, @@ -362,14 +362,14 @@ func TestConfigList(t *testing.T) { Values: []api.ConfigValue{ { Group: "global", - KV: api.KV{ + ConfigVar: api.ConfigVar{ Name: "NEW_URL2", Value: "http://localhost:8080/", }, }, { Ptype: "web", - KV: api.KV{ + ConfigVar: api.ConfigVar{ Name: "NEW_URL", Value: "http://localhost:8080", }, diff --git a/hooks/hooks_test.go b/hooks/hooks_test.go index 1633ce0..7d39cac 100644 --- a/hooks/hooks_test.go +++ b/hooks/hooks_test.go @@ -169,14 +169,14 @@ func TestConfigHook(t *testing.T) { Values: []api.ConfigValue{ { Group: "global", - KV: api.KV{ + ConfigVar: api.ConfigVar{ Name: "TEST", Value: "testing", }, }, { Group: "global", - KV: api.KV{ + ConfigVar: api.ConfigVar{ Name: "FOO", Value: "bar", },