Browse Source

Add delete method for kvstore

main
Sam 5 years ago
parent
commit
b83a1e0227
  1. 20
      kvstore.go
  2. 1
      types.go

20
kvstore.go

@ -103,3 +103,23 @@ func (kv KV) Put(namespace string, key string, value string) (KVAPI, error) {
} }
return r, nil return r, nil
} }
// Delete removes an entry
func (kv KV) Delete(namespace string, key string) (KVAPI, error) {
m := KVAPI{
Params: &kvParams{},
}
m.Params.Options = kvOptions{
Team: kv.Team,
Namespace: namespace,
EntryKey: key,
}
m.Method = "del"
r, err := kvAPIOut(kv.keybase, m)
if err != nil {
return r, err
}
return r, nil
}

1
types.go

@ -894,6 +894,7 @@ type kvInterface interface {
Keys(namespace string) (KVAPI, error) Keys(namespace string) (KVAPI, error)
Get(namespace string, key string) (KVAPI, error) Get(namespace string, key string) (KVAPI, error)
Put(namespace string, key string, value string) (KVAPI, error) Put(namespace string, key string, value string) (KVAPI, error)
Delete(namespace string, key string) (KVAPI, error)
} }
type keybase interface { type keybase interface {

Loading…
Cancel
Save