cacheprovider

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var WireSet = wire.NewSet(New)

WireSet provides wire bindings for cache provider

Functions

func CacheThis

func CacheThis[ResultT any, Err error](ctx context.Context,
	store cache.CacheProvider,
	ttl time.Duration,
	cacheKeyFn string,
	fetchFn func(context.Context) (ResultT, Err),
) (
	ResultT, Err,
)

func New

New creates a new cache provider with injected config. This replaces the singleton pattern in singleton/cache with dependency injection.

Types

This section is empty.

Jump to

Keyboard shortcuts

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