api: Logical delete

This commit is contained in:
Mitchell Hashimoto
2015-04-07 11:04:56 -07:00
parent 95c9fabbe2
commit 23a8cdc92a

View File

@@ -39,3 +39,14 @@ func (c *Logical) Write(path string, data map[string]interface{}) (*Secret, erro
return nil, nil
}
func (c *Logical) Delete(path string) (*Secret, error) {
r := c.c.NewRequest("DELETE", "/v1/"+path)
resp, err := c.c.RawRequest(r)
if err != nil {
return nil, err
}
defer resp.Body.Close()
return ParseSecret(resp.Body)
}