cache

package
v0.0.0-...-d65878b Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2022 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// ClusterIndexName is the name of the index that allows you to filter by cluster
	ClusterIndexName = "cluster"
	// ClusterAndNamespaceIndexName is the name of index that allows you to filter by cluster and namespace
	ClusterAndNamespaceIndexName = "cluster-and-namespace"
)

Variables

This section is empty.

Functions

func ClusterAndNamespaceIndexFunc

func ClusterAndNamespaceIndexFunc(obj interface{}) ([]string, error)

ClusterAndNamespaceIndexFunc indexes by cluster and namespace name

func ClusterAndNamespaceIndexKey

func ClusterAndNamespaceIndexKey(clusterName logicalcluster.Name, namespace string) string

ClusterAndNamespaceIndexKey formats the index key for a cluster name and namespace

func ClusterIndexFunc

func ClusterIndexFunc(obj interface{}) ([]string, error)

ClusterIndexFunc indexes by cluster name

func ClusterIndexKey

func ClusterIndexKey(clusterName logicalcluster.Name) string

ClusterIndexKey formats the index key for a cluster name

func DeletionHandlingMetaClusterNamespaceKeyFunc

func DeletionHandlingMetaClusterNamespaceKeyFunc(obj interface{}) (string, error)

DeletionHandlingMetaClusterNamespaceKeyFunc checks for DeletedFinalStateUnknown objects before calling MetaClusterNamespaceKeyFunc.

func ListAllByCluster

func ListAllByCluster(indexer cache.Indexer, cluster logicalcluster.Name, selector labels.Selector, appendFn cache.AppendFunc) error

ListAllByCluster used to list items belongs to a cluster from Indexer.

func ListAllByClusterAndNamespace

func ListAllByClusterAndNamespace(indexer cache.Indexer, cluster logicalcluster.Name, namespace string, selector labels.Selector, appendFn cache.AppendFunc) error

ListAllByClusterAndNamespace used to list items belongs to a cluster and namespace from Indexer.

func MetaClusterNamespaceKeyFunc

func MetaClusterNamespaceKeyFunc(obj interface{}) (string, error)

MetaClusterNamespaceKeyFunc is a convenient default KeyFunc which knows how to make keys for API objects which implement meta.Interface. The key uses the format <clusterName>|<namespace>/<name> unless <namespace> is empty, then it's just <clusterName>|<name>, and if running in a single-cluster context where no explicit cluster name is given, it's just <name>.

func SplitMetaClusterNamespaceKey

func SplitMetaClusterNamespaceKey(key string) (clusterName logicalcluster.Name, namespace, name string, err error)

SplitMetaClusterNamespaceKey returns the namespace and name that MetaClusterNamespaceKeyFunc encoded into key.

func ToClusterAwareKey

func ToClusterAwareKey(cluster, namespace, name string) string

ToClusterAwareKey formats a cluster, namespace, and name as a key.

Types

type ClusterLister

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

ClusterLister is a lister that supports multiple logical clusters. It can list the entire contents of the backing store, and return individual cache.GenericListers that are scoped to individual logical clusters.

func NewGenericClusterLister

func NewGenericClusterLister(indexer cache.Indexer, resource schema.GroupResource) *ClusterLister

NewGenericClusterLister creates a new instance for the ClusterLister.

func (*ClusterLister) ByCluster

func (s *ClusterLister) ByCluster(cluster logicalcluster.Name) cache.GenericLister

func (*ClusterLister) List

func (s *ClusterLister) List(selector labels.Selector) (ret []runtime.Object, err error)

type GenericClusterLister

type GenericClusterLister interface {
	// List will return all objects across logical clusters and all namespaces
	List(selector labels.Selector) (ret []runtime.Object, err error)
	// ByCluster will give you a cache.GenericLister for one logical cluster
	ByCluster(cluster logicalcluster.Name) cache.GenericLister
}

GenericClusterLister is a lister that can either list all objects across all logical clusters, or scope down to a lister for one logical cluster only.

type ScopeableSharedIndexInformer

type ScopeableSharedIndexInformer interface {
	Cluster(cluster logicalcluster.Name) cache.SharedIndexInformer
	cache.SharedIndexInformer
}

ScopeableSharedIndexInformer is an informer that knows how to scope itself down to one cluster, or act as an informer across clusters.

Jump to

Keyboard shortcuts

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