cache

package
v0.2.14 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider manages the lifecycle of cache instances. It uses lazy-loading with sync.Once to ensure instances are created only when needed and in a concurrency-safe manner.

func NewProvider

func NewProvider(logger runtimelog.Logger) *Provider

NewProvider creates a new, uninitialized Provider instance.

func (*Provider) Cache

func (p *Provider) Cache(name string) (storageiface.Cache, error)

Cache returns a single cache instance by name.

func (*Provider) Caches

func (p *Provider) Caches() (map[string]storageiface.Cache, error)

Caches returns a map of all available cache instances. On the first call, it lazily creates and caches instances based on the configuration.

func (*Provider) DefaultCache

func (p *Provider) DefaultCache(globalDefaultName string) (storageiface.Cache, error)

DefaultCache returns the default cache instance.

func (*Provider) Initialize

func (p *Provider) Initialize(cfg *datav1.Caches, opts ...options.Option)

Initialize configures the provider with the necessary configuration and options.

func (*Provider) RegisterCache

func (p *Provider) RegisterCache(name string, c storageiface.Cache)

RegisterCache allows for manual registration of a cache instance.

Jump to

Keyboard shortcuts

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