Categorygithub.com/Hartimer/loadingcache
modulepackage
0.1.0
Repository: https://github.com/hartimer/loadingcache.git
Documentation: pkg.go.dev

# README

[godoc][godoc] Go Report Card Coverage

# Packages

No description provided by the author
Code generated by github.com/Hartimer/loadingcache/cmd/typedcache, DO NOT EDIT.

# Functions

New instantiates a new cache.

# Constants

RemovalReasonExpired means the entry expired, e.g.
RemovalReasonExplicit means the entry was explicitly invalidated.
RemovalReasonReplaced means the entry was replaced by a new one.
RemovalReasonSize means the entry was removed due to the cache size.

# Variables

ErrKeyNotFound represents an error indicating that the key was not found.

# Structs

CacheOptions available options to initialize the cache.
RemovalNotification is passed to listeners everytime an entry is removed.

# Interfaces

Cache describe the base interface to interact with a generic cache.
Stats exposes cache relevant metrics.

# Type aliases

CacheOption describes an option that can configure the cache.
LoadFunc represents a function that given a key, it returns a value or an error.
RemovalListener represents a removal listener.
RemovalReason is an enum describing the causes for an entry to be removed from the cache.