Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache[K comparable, V Cacheable[K]] struct { // contains filtered or unexported fields }
Cache is a goroutine safe write-through cache with generics type.
func NewCache ¶
func NewCache[K comparable, V Cacheable[K]](read func(K) (V, error), write func(V) error) *Cache[K, V]
NewCache creates a new Cache.
type Cacheable ¶
type Cacheable[K comparable] interface { CacheKey() K }
Click to show internal directories.
Click to hide internal directories.