Created
September 17, 2014 16:46
-
-
Save anandkunal/7f11b1be31236276ee4e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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