sfcache

package
v1.3.8 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SingleflightCache

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

func NewSingleflightCache

func NewSingleflightCache[T comparable]() *SingleflightCache[T]

func (*SingleflightCache[T]) Do

func (c *SingleflightCache[T]) Do(key string, fn func() (T, error)) (T, error)

func (*SingleflightCache[T]) ForgetCacheKey

func (c *SingleflightCache[T]) ForgetCacheKey(key string)

func (*SingleflightCache[T]) OverwriteCacheKey

func (c *SingleflightCache[T]) OverwriteCacheKey(key string, val T)

Jump to

Keyboard shortcuts

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