accessor

package
v2.7.1-0...-5f38440 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOrCreate

func GetOrCreate[T any, A Accessor[T]](ctx context.Context, s *types.State) (*T, error)

GetOrCreate gets an Accessor or creates one (and sets to the State) if one wasn't set.

func Memoize

func Memoize[R any](c cache.Cache, calculate func() R) R

Memoize caches the result of a function and reuses it on a next call.

Types

type Accessor

type Accessor[T any] interface {
	SystemArtifact() *biosimage.BIOSImage
	Init(img *biosimage.BIOSImage, cache cache.Cache)

	*T
}

Accessor is an abstract data accessor of implementation-specific data.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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