Documentation
¶
Index ¶
- type Provider
- func (p *Provider) Cache(name string) (storageiface.Cache, error)
- func (p *Provider) Caches() (map[string]storageiface.Cache, error)
- func (p *Provider) DefaultCache(globalDefaultName string) (storageiface.Cache, error)
- func (p *Provider) Initialize(cfg *datav1.Caches, opts ...options.Option)
- func (p *Provider) RegisterCache(name string, c storageiface.Cache)
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 ¶
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.
Click to show internal directories.
Click to hide internal directories.