goldfish

package
v1.35.3 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package goldfish provides a short-term cache of values.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache[V any] struct {
	// contains filtered or unexported fields
}

func New

func New[V any](keepalive time.Duration, fn func() (V, error)) *Cache[V]

func (*Cache[V]) Get

func (c *Cache[V]) Get() (V, error)

func (*Cache[V]) Set

func (c *Cache[V]) Set(val V)

Jump to

Keyboard shortcuts

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