diff --git a/kvstore.go b/kvstore.go index 472f974..4764a51 100644 --- a/kvstore.go +++ b/kvstore.go @@ -103,3 +103,23 @@ func (kv KV) Put(namespace string, key string, value string) (KVAPI, error) { } 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 +} diff --git a/types.go b/types.go index 7581df6..06e8fa4 100644 --- a/types.go +++ b/types.go @@ -894,6 +894,7 @@ type kvInterface interface { Keys(namespace string) (KVAPI, error) Get(namespace string, key string) (KVAPI, error) Put(namespace string, key string, value string) (KVAPI, error) + Delete(namespace string, key string) (KVAPI, error) } type keybase interface {