package
0.0.0-20181219170729-6602e3a93089
Repository: https://github.com/travelgatex/go-cache.git
Documentation: pkg.go.dev
# Functions
New creates a new instance of FetcherLRU.
SetBlockOnUpdatingGoroutine makes the calling goroutine to block until the new value is fetched.
SetEvictFunc sets a callback func executed on an item eviction.
# Constants
ErrTimeout is the value returned by Gets to cache with a given timeout.
ErrWrongMFetchResult happens when a MFetchFunc doesn't return results for every value requested.
# Structs
FetcherLRU wraps https://github.com/hashicorp/golang-lru providing ttl, stats and singleflight
Satisfies an use case where the cache is filled by demand: the gets are done by key and an OnFetch func that is executed when the key is not found or has expired, the OnFetch Result will be stored in cache for that key.
FetcherLRUOptions are optional paratemer for a customized FetcherLRU instance.
Result holds the results of Get, so they can be passed on a channel.
No description provided by the author
# Type aliases
FetcherLRUOption is a function that sets some option on the FetcherLRU.
FetchFunc result is stored in cache, if value is nil, it will be considered as empty and an empty item will be stored.
MFetchFunc expects the values returned to be in the same order as the keySuffixes requested.