cache

package
v0.0.0-...-b8483cf Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2025 License: MIT Imports: 1 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, E any] struct {
	// contains filtered or unexported fields
}

Cache is a simple cache. Zero value is not usable, use New.

func New

func New[K comparable, E any](getter func(key K) E) *Cache[K, E]

func (*Cache[K, E]) Get

func (c *Cache[K, E]) Get(key K) E

type ConcCache

type ConcCache[K comparable, E any] struct {
	Cache[K, E]
	// contains filtered or unexported fields
}

func NewConc

func NewConc[K comparable, E any](getter func(key K) E) *ConcCache[K, E]

func (*ConcCache[K, E]) Get

func (c *ConcCache[K, E]) Get(key K) E

Jump to

Keyboard shortcuts

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