cache_helper

package
v5.0.0-...-ad4f444 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustResolveCache

func MustResolveCache(ctx context.Context, name string, config cache.Config) cache.Cache

MustResolveCache forces the Config.DiscardFallback to true and returns ResolveCache without error If the cache opening fails, it returns a DiscardCache

func RegisterCachePool

func RegisterCachePool(scheme string, opener cache.URLOpener)

RegisterCachePool is a helper for cache pool registration

func ResolveCache

func ResolveCache(ctx context.Context, name string, config cache.Config) (cache.Cache, error)

ResolveCache looks up for manager in context and finds the corresponding cache

func SetCacheRegistryResolver

func SetCacheRegistryResolver(r CacheRegistryResolver)

SetCacheRegistryResolver registers a resolver for finding CacheRegistry

func SetStaticResolver

func SetStaticResolver(url string, opener cache.URLOpener)

Types

type CacheRegistry

type CacheRegistry interface {
	RegisterCache(scheme string, opts ...controller.Option[*openurl.Pool[cache.Cache]])
	GetCache(ctx context.Context, name string, resolutionData map[string]interface{}) (cache.Cache, error)
}

CacheRegistry defines a subset of the Manager interface

type CacheRegistryResolver

type CacheRegistryResolver func(ctx context.Context) (CacheRegistry, error)

Jump to

Keyboard shortcuts

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