cache

package
v0.0.0-...-f1ac91e Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FieldIndexName

func FieldIndexName(field string) string

FieldIndexName constructs the name of the index over the given field, for use with an indexer.

func KeyToNamespacedKey

func KeyToNamespacedKey(ns string, baseKey string) string

KeyToNamespacedKey prefixes the given index key with a namespace for use in field selector indexes.

Types

type Cache

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

func New

func New(client *client2.Client) *Cache

func (*Cache) Get

func (c *Cache) Get(ctx context.Context, key client.ObjectKey, obj client.Object) error

func (*Cache) GetInformer

func (c *Cache) GetInformer(ctx context.Context, obj client.Object) (cache.Informer, error)

func (*Cache) GetInformerForKind

func (c *Cache) GetInformerForKind(ctx context.Context, gvk schema.GroupVersionKind) (cache.Informer, error)

func (*Cache) IndexField

func (c *Cache) IndexField(ctx context.Context, obj client.Object, field string, extractValue client.IndexerFunc) error

IndexField adds an indexer to the underlying cache, using extraction function to get value(s) from the given field. This index can then be used by passing a field selector to List. For one-to-one compatibility with "normal" field selectors, only return one value. The values may be anything. They will automatically be prefixed with the namespace of the given object, if present. The objects passed are guaranteed to be objects of the correct type.

func (*Cache) List

func (c *Cache) List(ctx context.Context, listObj client.ObjectList, opts ...client.ListOption) error

func (*Cache) Start

func (c *Cache) Start(ctx context.Context) error

func (*Cache) WaitForCacheSync

func (c *Cache) WaitForCacheSync(ctx context.Context) bool

Jump to

Keyboard shortcuts

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