Index | Files

package cache

import ""


Package Files


type Cache Uses

type Cache struct {

    Name string
    // contains filtered or unexported fields

func New Uses

func New(name string, MaxEntries int) *Cache

New creates a new LRU cache of the request length with an exported Name for instrumentation

func (*Cache) Get Uses

func (c *Cache) Get(key string, getFn func() (interface{}, error)) (i interface{}, err error, hit bool)

Get returns a cached value based on the passed key or runs the passed function to get the value if there is no corresponding value in the cache

Package cache imports 3 packages (graph) and is imported by 3 packages. Updated 2018-08-07. Refresh now. Tools for package owners.