clientv3: make YamlConfig struct private

This commit is contained in:
Anthony Romano 2016-04-14 12:26:01 -07:00
parent ba1c0a2b12
commit 04ef861c3d
2 changed files with 8 additions and 8 deletions

View File

@ -45,7 +45,7 @@ type Config struct {
Logger Logger
}
type YamlConfig struct {
type yamlConfig struct {
Endpoints []string `json:"endpoints"`
DialTimeout time.Duration `json:"dial-timeout"`
InsecureTransport bool `json:"insecure-transport"`
@ -61,7 +61,7 @@ func configFromFile(fpath string) (*Config, error) {
return nil, err
}
yc := &YamlConfig{}
yc := &yamlConfig{}
err = yaml.Unmarshal(b, yc)
if err != nil {

View File

@ -32,22 +32,22 @@ var (
func TestConfigFromFile(t *testing.T) {
tests := []struct {
ym *YamlConfig
ym *yamlConfig
werr bool
}{
{
&YamlConfig{},
&yamlConfig{},
false,
},
{
&YamlConfig{
&yamlConfig{
InsecureTransport: true,
},
false,
},
{
&YamlConfig{
&yamlConfig{
Keyfile: privateKeyPath,
Certfile: certPath,
CAfile: caPath,
@ -56,14 +56,14 @@ func TestConfigFromFile(t *testing.T) {
false,
},
{
&YamlConfig{
&yamlConfig{
Keyfile: "bad",
Certfile: "bad",
},
true,
},
{
&YamlConfig{
&yamlConfig{
Keyfile: privateKeyPath,
Certfile: certPath,
CAfile: "bad",