Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FieldIndexName ¶
FieldIndexName constructs the name of the index over the given field, for use with an indexer.
func KeyToNamespacedKey ¶
KeyToNamespacedKey prefixes the given index key with a namespace for use in field selector indexes.
Types ¶
type Cache ¶ added in v0.15.0
type Cache struct { // Informer is the cached informer Informer cache.SharedIndexInformer // CacheReader wraps Informer and implements the CacheReader interface for a single type Reader CacheReader }
Cache contains the cached data for an Cache.
type CacheReader ¶
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 ¶
func (c *CacheReader) Get(_ context.Context, key client.ObjectKey, out client.Object, opts ...client.GetOption) error
Get checks the indexer for the object and writes a copy of it if found.
func (*CacheReader) List ¶
func (c *CacheReader) List(_ context.Context, out client.ObjectList, opts ...client.ListOption) error
List lists items out of the indexer and writes them to out.
type Informers ¶ added in v0.15.0
type Informers struct {
// contains filtered or unexported fields
}
Informers create and caches Informers for (runtime.Object, schema.GroupVersionKind) pairs. It uses a standard parameter codec constructed based on the given generated Scheme.
func NewInformers ¶ added in v0.15.0
func NewInformers(config *rest.Config, options *InformersOpts) *Informers
NewInformers creates a new InformersMap that can create informers under the hood.
func (*Informers) Get ¶ added in v0.15.0
func (ip *Informers) Get(ctx context.Context, gvk schema.GroupVersionKind, obj runtime.Object) (bool, *Cache, error)
Get will create a new Informer and add it to the map of specificInformersMap if none exists. Returns the Informer from the map.
type InformersOpts ¶ added in v0.15.0
type InformersOpts struct { HTTPClient *http.Client Scheme *runtime.Scheme Mapper meta.RESTMapper ResyncPeriod time.Duration Namespace string ByGVK map[schema.GroupVersionKind]InformersOptsByGVK }
InformersOpts configures an InformerMap.
type InformersOptsByGVK ¶ added in v0.15.0
type InformersOptsByGVK struct { Selector Selector Transform cache.TransformFunc UnsafeDisableDeepCopy *bool }
InformersOptsByGVK configured additional by group version kind (or object) in an InformerMap.
type Selector ¶ added in v0.9.0
Selector specify the label/field selector to fill in ListOptions.
func (Selector) ApplyToList ¶ added in v0.9.0
func (s Selector) ApplyToList(listOpts *metav1.ListOptions)
ApplyToList fill in ListOptions LabelSelector and FieldSelector if needed.
type TransformFuncByGVK ¶ added in v0.15.0
type TransformFuncByGVK interface { Set(runtime.Object, *runtime.Scheme, cache.TransformFunc) error Get(schema.GroupVersionKind) cache.TransformFunc SetDefault(transformer cache.TransformFunc) }
TransformFuncByGVK provides access to the correct transform function for any given GVK.
func TransformFuncByGVKFromMap ¶ added in v0.15.0
func TransformFuncByGVKFromMap(in map[schema.GroupVersionKind]cache.TransformFunc) TransformFuncByGVK
TransformFuncByGVKFromMap creates a TransformFuncByGVK from a map that maps GVKs to TransformFuncs.