cache

package
v1.81.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: Apache-2.0, BSD-2-Clause, MIT, + 1 more Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAPIError

func IsAPIError(err error) bool

IsAPIError checks if the given error is API related.

func NewAggregator

func NewAggregator(fallbackCache cache.Cache, gvkToCache map[schema.GroupVersionKind]cache.Cache, scheme *runtime.Scheme) cache.Cache

NewAggregator creates a new instance of an aggregated cache.

func NewCacheError

func NewCacheError(err error) error

NewCacheError returns a new instance of `CacheError`.

func NewSingleObject added in v1.67.0

func NewSingleObject(
	log logr.Logger,
	restConfig *rest.Config,
	newCache cache.NewCacheFunc,
	opts cache.Options,
	gvk schema.GroupVersionKind,
	clock clock.Clock,
	maxIdleTime time.Duration,
	garbageCollectionInterval time.Duration,
) cache.Cache

NewSingleObject creates a new instance of the singleObject cache.Cache implementation. This cache maintains a separate cache per `client.ObjectKey` and invalidates them when not accessed for the given `maxIdleTime`. A new cache for a particular object is added or re-added as soon as the caches `Get()` function is invoked. Please note that object types are not differentiated by this cache (only object keys), i.e. it must not be used with mixed GVKs.

Types

type CacheError

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

CacheError is an error type indicating that an cache error occurred.

func (*CacheError) Error

func (e *CacheError) Error() string

Error returns the error string with the underlying error.

func (*CacheError) Unwrap

func (e *CacheError) Unwrap() error

Unwrap returns the next error in the error chain.

Jump to

Keyboard shortcuts

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