cache

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: Apache-2.0 Imports: 16 Imported by: 21

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCache

func NewCache(obj, listObj runtime.Object, client *client.Client, opts *Options) cache.SharedIndexInformer

Types

type CancelCollection

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

func (*CancelCollection) Add

func (c *CancelCollection) Add(ctx context.Context, obj interface{})

func (*CancelCollection) List

func (c *CancelCollection) List() (result []interface{})

type Options

type Options struct {
	Namespace        string
	Resync           time.Duration
	TweakList        TweakListOptionsFunc
	WaitHealthy      func(ctx context.Context)
	DisableWatchList bool
}

type SharedCacheFactory

type SharedCacheFactory interface {
	Start(ctx context.Context) error
	StartGVK(ctx context.Context, gvk schema.GroupVersionKind) error
	ForObject(obj runtime.Object) (cache.SharedIndexInformer, error)
	ForKind(gvk schema.GroupVersionKind) (cache.SharedIndexInformer, error)
	ForResource(gvr schema.GroupVersionResource, namespaced bool) (cache.SharedIndexInformer, error)
	ForResourceKind(gvr schema.GroupVersionResource, kind string, namespaced bool) (cache.SharedIndexInformer, error)
	WaitForCacheSync(ctx context.Context) map[schema.GroupVersionKind]bool
	SharedClientFactory() client.SharedClientFactory
}

func NewSharedCachedFactory

func NewSharedCachedFactory(sharedClientFactory client.SharedClientFactory, opts *SharedCacheFactoryOptions) SharedCacheFactory

NewSharedInformerFactoryWithOptions constructs a new instance of a SharedInformerFactory with additional options.

type SharedCacheFactoryOptions

type SharedCacheFactoryOptions struct {
	DefaultResync           time.Duration
	DefaultNamespace        string
	DefaultTweakList        TweakListOptionsFunc
	DefaultDisableWatchList bool

	KindResync           map[schema.GroupVersionKind]time.Duration
	KindNamespace        map[schema.GroupVersionKind]string
	KindTweakList        map[schema.GroupVersionKind]TweakListOptionsFunc
	KindDisableWatchList map[schema.GroupVersionKind]bool
	HealthCallback       func(healthy bool)

	// Determines how often metrics are gathered about how many resources are
	// cached by gvk across all caches in the sharedCacheFactory
	MetricsCollectionPeriod time.Duration
}

type TweakListOptionsFunc

type TweakListOptionsFunc func(*v1.ListOptions)

Jump to

Keyboard shortcuts

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