Skip to content

Instantly share code, notes, and snippets.

@anandkunal
Created September 17, 2014 16:46
Show Gist options
  • Save anandkunal/7f11b1be31236276ee4e to your computer and use it in GitHub Desktop.
Save anandkunal/7f11b1be31236276ee4e to your computer and use it in GitHub Desktop.
func (c *Client) Get(key string) (*CacheItem, error) {
var item *CacheItem
err := c.connection.Call("RPC.Get", key, &item)
return item, err
}
func (c *Client) Put(item *CacheItem) (bool, error) {
var added bool
err := c.connection.Call("RPC.Put", item, &added)
return added, err
}
func (c *Client) Delete(key string) (bool, error) {
var deleted bool
err := c.connection.Call("RPC.Delete", key, &deleted)
return deleted, err
}
func (c *Client) Clear() (bool, error) {
var cleared bool
err := c.connection.Call("RPC.Clear", true, &cleared)
return cleared, err
}
func (c *Client) Stats() (*Requests, error) {
requests := &Requests{}
err := c.connection.Call("RPC.Stats", true, requests)
return requests, err
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment