controller-runtime: sigs.k8s.io/controller-runtime/pkg/cache/internal Index | Files

package internal

import "sigs.k8s.io/controller-runtime/pkg/cache/internal"

Index

Package Files

cache_reader.go deleg_map.go informers_map.go

func FieldIndexName Uses

func FieldIndexName(field string) string

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

func KeyToNamespacedKey Uses

func KeyToNamespacedKey(ns string, baseKey string) string

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

type CacheReader Uses

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

CacheReader wraps a cache.Index to implement the client.CacheReader interface for a single type

func (*CacheReader) Get Uses

func (c *CacheReader) Get(_ context.Context, key client.ObjectKey, out runtime.Object) error

Get checks the indexer for the object and writes a copy of it if found

func (*CacheReader) List Uses

func (c *CacheReader) List(_ context.Context, out runtime.Object, opts ...client.ListOptionFunc) error

List lists items out of the indexer and writes them to out

type InformersMap Uses

type InformersMap struct {

    // Scheme maps runtime.Objects to GroupVersionKinds
    Scheme *runtime.Scheme
    // contains filtered or unexported fields
}

InformersMap create and caches Informers for (runtime.Object, schema.GroupVersionKind) pairs. It uses a standard parameter codec constructed based on the given generated Scheme.

func NewInformersMap Uses

func NewInformersMap(config *rest.Config,
    scheme *runtime.Scheme,
    mapper meta.RESTMapper,
    resync time.Duration,
    namespace string) *InformersMap

NewInformersMap creates a new InformersMap that can create informers for both structured and unstructured objects.

func (*InformersMap) Get Uses

func (m *InformersMap) Get(gvk schema.GroupVersionKind, obj runtime.Object) (*MapEntry, error)

Get will create a new Informer and add it to the map of InformersMap if none exists. Returns the Informer from the map.

func (*InformersMap) Start Uses

func (m *InformersMap) Start(stop <-chan struct{}) error

Start calls Run on each of the informers and sets started to true. Blocks on the stop channel.

func (*InformersMap) WaitForCacheSync Uses

func (m *InformersMap) WaitForCacheSync(stop <-chan struct{}) bool

WaitForCacheSync waits until all the caches have been synced.

type MapEntry Uses

type MapEntry struct {
    // Informer is the cached informer
    Informer cache.SharedIndexInformer

    // CacheReader wraps Informer and implements the CacheReader interface for a single type
    Reader CacheReader
}

MapEntry contains the cached data for an Informer

Package internal imports 22 packages (graph) and is imported by 4 packages. Updated 2019-07-14. Refresh now. Tools for package owners.