From e617197871d07a3ae795041cb52155e97e8fff9c Mon Sep 17 00:00:00 2001 From: Daniel Dao Date: Mon, 6 Nov 2017 14:46:18 +0000 Subject: [PATCH] storage/etcd: document struct tag in code This explicitly adds struct tags for etcd storage instead of implicitly depends on yaml/json config serialization. --- storage/etcd/config.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/storage/etcd/config.go b/storage/etcd/config.go index 0c52227a..ad273968 100644 --- a/storage/etcd/config.go +++ b/storage/etcd/config.go @@ -16,10 +16,10 @@ var ( // SSL represents SSL options for etcd databases. type SSL struct { - ServerName string - CAFile string - KeyFile string - CertFile string + ServerName string `json:"serverName" yaml:"serverName"` + CAFile string `json:"caFile" yaml:"caFile"` + KeyFile string `json:"keyFile" yaml:"keyFile"` + CertFile string `json:"certFile" yaml:"certFile"` } // Etcd options for connecting to etcd databases. @@ -27,11 +27,11 @@ type SSL struct { // configure an etcd namespace either via Namespace field or using `etcd grpc-proxy // --namespace=` type Etcd struct { - Endpoints []string - Namespace string - Username string - Password string - SSL SSL + Endpoints []string `json:"endpoints" yaml:"endpoints"` + Namespace string `json:"namespace" yaml:"namespace"` + Username string `json:"username" yaml:"username"` + Password string `json:"password" yaml:"password"` + SSL SSL `json:"ssl" yaml:"ssl"` } // Open creates a new storage implementation backed by Etcd