cache

package
v0.1.14-dev4 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewNoOpKeyValueCache

func NewNoOpKeyValueCache[T any]() *noOpKeyValueCache[T]

NewKeyValueCache returns a new instance of a KeyValueCache.

func NewNoOpParamsCache

func NewNoOpParamsCache[T any]() *noOpParamsCache[T]

NewParamsCache returns a new instance of a ParamsCache.

func NewParamsCache

func NewParamsCache[T any](opts ...memory.KeyValueCacheOptionFn) (*paramsCache[T], error)

NewParamsCache returns a new instance of a ParamsCache.

func WithNewBlockCacheClearing

func WithNewBlockCacheClearing[C Cache](ctx context.Context, deps depinject.Config, cache C) error

WithNewBlockCacheClearing is a cache option that clears the cache every time a new block is observed.

Types

type Cache

type Cache interface {
	Clear()
}

Cache is an interface that defines the common methods for a cache object.

type CacheOption

type CacheOption[C Cache] func(context.Context, depinject.Config, C) error

CacheOption is a function type for the option functions that can customize the cache behavior.

Jump to

Keyboard shortcuts

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