Delete deletes the item with the provided key. The error ErrCacheMiss is returned if the item didn't already exist in the cache.
(key string)
| 738 | // Delete deletes the item with the provided key. The error ErrCacheMiss is |
| 739 | // returned if the item didn't already exist in the cache. |
| 740 | func (c *Client) Delete(key string) error { |
| 741 | return c.withKeyRw(key, func(conn *conn) error { |
| 742 | return writeExpectf(conn.rw, resultDeleted, "delete %s\r\n", key) |
| 743 | }) |
| 744 | } |
| 745 | |
| 746 | // DeleteAll deletes all items in the cache. |
| 747 | func (c *Client) DeleteAll() error { |