cache

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: MIT Imports: 4 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[O any] struct {
	// contains filtered or unexported fields
}

func New

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

func (*Cache[O]) Get

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

type FetchFunc

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

Jump to

Keyboard shortcuts

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