Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrKeyNotFound indicates the cache not found. ErrKeyNotFound = errors.New("key not found") )
Functions ¶
This section is empty.
Types ¶
type LoaderFunc ¶
type LoaderFunc func(key interface{}) (interface{}, error)
LoaderFunc load values for a cache key.
type PipeCache ¶
type PipeCache struct {
// contains filtered or unexported fields
}
PipeCache limits cache loader (load values from remote services) in a pipe, which means limit the concurrence. NOTE: The refactor version here only allows 1 concurrent to load for simple implementation reason.
func NewPipeCache ¶
NewPipeCache create a new piped cache.
Click to show internal directories.
Click to hide internal directories.