Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ICache ¶
type ICache interface { // Get looks up a key's value from the cache. Get(key interface{}) (value interface{}, ok bool) // Add adds a value to the cache. Add(key, value interface{}) // Len returns the number of cached entries Len() int // Keys returns all the cached keys Keys() []interface{} // Remove is used to purge a key from the cache Remove(key interface{}) // Purge is used to clear the cache Purge() // Contains is used to check if the cache contains a key // without updating recency or frequency. Contains(key interface{}) bool // Peek is used to inspect the cache value of a key // without updating recency or frequency. Peek(key interface{}) (value interface{}, ok bool) }
LRU 接口
type Memo ¶
type Memo struct {
// contains filtered or unexported fields
}
func New ¶
func New(options ...MenoOption) *Memo
New returns a memoization of f. Clients must subsequently call Close.
type MenoOption ¶
type MenoOption func(*Memo)
func MenoCallback ¶
func MenoCallback(fname string, f Func) MenoOption
func MenoReqCount ¶
func MenoReqCount(count int64) MenoOption
func MenoTimeout ¶
func MenoTimeout(timeout time.Duration) MenoOption
Click to show internal directories.
Click to hide internal directories.