Documentation ¶ Index ¶ Variables type Cache func NewCache(defaultExpirationInSeconds int) *Cache func (this *Cache) Use(key string, expiration time.Duration, getter func() (interface{}, error), ...) (err error) func (this *Cache) UseWithExpirationInResult(key string, getter func() (interface{}, time.Duration, error), ...) (err error) type Item Constants ¶ This section is empty. Variables ¶ View Source var ErrNotFound = errors.New("key not found in cache") Functions ¶ This section is empty. Types ¶ type Cache ¶ type Cache struct { // contains filtered or unexported fields } func NewCache ¶ func NewCache(defaultExpirationInSeconds int) *Cache func (*Cache) Use ¶ func (this *Cache) Use(key string, expiration time.Duration, getter func() (interface{}, error), result interface{}) (err error) func (*Cache) UseWithExpirationInResult ¶ func (this *Cache) UseWithExpirationInResult(key string, getter func() (interface{}, time.Duration, error), result interface{}) (err error) type Item ¶ type Item struct { Key string Value []byte } Source Files ¶ View all Source files cache.go Click to show internal directories. Click to hide internal directories.