cache

package
v0.11.6 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: MIT Imports: 4 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

func New

func New[K any, O any](expiration time.Duration, fetch FetchFunc[K, O]) *Cache[K, O]

func (*Cache[K, O]) Get

func (c *Cache[K, O]) Get(ctx context.Context, key K) (O, error)

type FetchFunc

type FetchFunc[K any, O any] func(ctx context.Context, key K) (O, error)

Jump to

Keyboard shortcuts

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