cache

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheValue added in v0.1.0

type CacheValue[T comparable] struct {
	// contains filtered or unexported fields
}

func NewCacheValue added in v0.1.0

func NewCacheValue[T comparable](validity time.Duration) *CacheValue[T]

func (*CacheValue[T]) Get added in v0.1.0

func (v *CacheValue[T]) Get(origin func() (T, error)) (T, error)

func (*CacheValue[T]) GetCached added in v0.1.0

func (v *CacheValue[T]) GetCached() (T, bool)

func (*CacheValue[T]) HasValue added in v0.1.0

func (v *CacheValue[T]) HasValue() bool

func (*CacheValue[T]) Set added in v0.1.0

func (v *CacheValue[T]) Set(value T)

Jump to

Keyboard shortcuts

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