Documentation
¶
Overview ¶
Package cache implements a cache
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Cache = cache.New(defaultExpire, defaultPurge)
Cache provides an in-memory key:value store similar to memcached
Functions ¶
func Get ¶
Get returns the value for 'key'.
cache hit:
pull the value from the cache and returns it.
cache miss:
call 'cb' function to get a new value. If the callback doesn't return an error the returned value is cached with no expiration date and returned.
func GetWithExpiration ¶
GetWithExpiration returns the value for 'key'.
cache hit:
pull the value from the cache and returns it.
cache miss:
call 'cb' function to get a new value. If the callback doesn't return an error the returned value is cached with the given expire duration and returned.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.