cachelib

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache[K comparable, L any] struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewCache

func NewCache[K comparable, L any](fetch func(K) *L, refresh time.Duration) Cache[K, L]

func (*Cache[K, L]) Get

func (c *Cache[K, L]) Get(index K) *L

type CacheItem

type CacheItem[K any] struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL