cache

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2024 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, V any] struct {
	// contains filtered or unexported fields
}

func New

func New[K comparable, V any](getter Getter[K, V]) *Cache[K, V]

func (Cache[K, V]) Lookup

func (c Cache[K, V]) Lookup(ctx context.Context, key K) (V, error)

type Getter

type Getter[K comparable, V any] interface {
	Lookup(context.Context, K) (V, error)
}

Jump to

Keyboard shortcuts

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