@@ -33,6 +33,7 @@ type etcdPlugin struct {
33
33
mutex * sync.Mutex
34
34
}
35
35
36
+ // EtcdClient has etcd client state
36
37
type EtcdClient struct {
37
38
client client.Client // etcd client
38
39
kapi client.KeysAPI
@@ -94,7 +95,7 @@ func (ep *etcdPlugin) NewClient(endpoints []string) (API, error) {
94
95
return ec , nil
95
96
}
96
97
97
- // Get an object
98
+ // GetObj Get an object
98
99
func (ep * EtcdClient ) GetObj (key string , retVal interface {}) error {
99
100
keyName := "/contiv.io/obj/" + key
100
101
@@ -128,7 +129,7 @@ func recursAddNode(node *client.Node, list []string) []string {
128
129
return list
129
130
}
130
131
131
- // Get a list of objects in a directory
132
+ // ListDir Get a list of objects in a directory
132
133
func (ep * EtcdClient ) ListDir (key string ) ([]string , error ) {
133
134
keyName := "/contiv.io/obj/" + key
134
135
@@ -159,7 +160,7 @@ func (ep *EtcdClient) ListDir(key string) ([]string, error) {
159
160
return retList , nil
160
161
}
161
162
162
- // Save an object, create if it doesnt exist
163
+ // SetObj Save an object, create if it doesnt exist
163
164
func (ep * EtcdClient ) SetObj (key string , value interface {}) error {
164
165
keyName := "/contiv.io/obj/" + key
165
166
@@ -179,7 +180,7 @@ func (ep *EtcdClient) SetObj(key string, value interface{}) error {
179
180
return nil
180
181
}
181
182
182
- // Remove an object
183
+ // DelObj Remove an object
183
184
func (ep * EtcdClient ) DelObj (key string ) error {
184
185
keyName := "/contiv.io/obj/" + key
185
186
@@ -215,7 +216,7 @@ func httpGetJSON(url string, data interface{}) (interface{}, error) {
215
216
return data , nil
216
217
}
217
218
218
- // Return the local address where etcd is listening
219
+ // GetLocalAddr Return the local address where etcd is listening
219
220
func (ep * EtcdClient ) GetLocalAddr () (string , error ) {
220
221
var epData struct {
221
222
Name string `json:"name"`
0 commit comments