cache

package
v0.0.0-...-5993b26 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 15 Imported by: 16

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)
}

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

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

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