|
|
|
@ -82,3 +82,24 @@ func (kv KV) Get(namespace string, key string) (KVAPI, error) {
@@ -82,3 +82,24 @@ func (kv KV) Get(namespace string, key string) (KVAPI, error) {
|
|
|
|
|
} |
|
|
|
|
return r, nil |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Put adds an entry
|
|
|
|
|
func (kv KV) Put(namespace string, key string, value string) (KVAPI, error) { |
|
|
|
|
m := KVAPI{ |
|
|
|
|
Params: &kvParams{}, |
|
|
|
|
} |
|
|
|
|
m.Params.Options = kvOptions{ |
|
|
|
|
Team: kv.Team, |
|
|
|
|
Namespace: namespace, |
|
|
|
|
EntryKey: key, |
|
|
|
|
EntryValue: value, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
m.Method = "put" |
|
|
|
|
|
|
|
|
|
r, err := kvAPIOut(kv.keybase, m) |
|
|
|
|
if err != nil { |
|
|
|
|
return r, err |
|
|
|
|
} |
|
|
|
|
return r, nil |
|
|
|
|
} |
|
|
|
|