Documentation
¶
Index ¶
- func NewKubeClientFromGlobalInformer(gi GlobalInformer, clusterID ClusterID) (client kube.Client, err error)
- func WithNonTerminatedPods[T runtime.Object](config *ListConfig[T])
- type Cluster
- type ClusterID
- type ClusterResourceEventHandler
- type ClusterWatchErrorHandler
- type FilterFunction
- type GlobalInformer
- type KubeClient
- type ListConfig
- type ListOption
- func FromMetaListOptions[T runtime.Object](opts metav1.ListOptions) (res []ListOption[T])
- func InNamespaces[T runtime.Object](namespaces ...string) ListOption[T]
- func WithCustomFilter[T runtime.Object](fn FilterFunction[T]) ListOption[T]
- func WithCustomPreFilter[T runtime.Object](fn PreFilterFunction) ListOption[T]
- func WithLabelSelector[T runtime.Object](selector labels.Selector) ListOption[T]
- func WithLabelSelectorStr[T runtime.Object](selector string) (opt ListOption[T], err error)
- func WithLabelsMap[T runtime.Object](m map[string]string) ListOption[T]
- func WithMetaLabelSelector[T runtime.Object](selector *metav1.LabelSelector) (opt ListOption[T], err error)
- func WithNames[T runtime.Object](names ...string) ListOption[T]
- func WithOwnerReference[T runtime.Object](gvk schema.GroupVersionKind, name string) ListOption[T]
- func WithPagination[T runtime.Object](less func(a, b *unstructured.Unstructured) bool, offset, limit int, ...) ListOption[T]
- type PreFilterFunction
- type ResourceBuilder
- type ResourceUnit
- type ResourceUnitWithHandlers
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewKubeClientFromGlobalInformer ¶
func NewKubeClientFromGlobalInformer(gi GlobalInformer, clusterID ClusterID) (client kube.Client, err error)
func WithNonTerminatedPods ¶
func WithNonTerminatedPods[T runtime.Object](config *ListConfig[T])
Types ¶
type FilterFunction ¶
type GlobalInformer ¶
type GlobalInformer interface { // cluster cares GetCluster(id ClusterID) Cluster ListClusters() (clusters []Cluster) AddCluster(clusterID ClusterID, client kube.Client, defaultResync time.Duration, tweakListOptions dynamicinformer.TweakListOptionsFunc, watchUnits []ResourceUnitWithHandlers) RemoveCluster(clusterID ClusterID) HasSynced(clusterID ClusterID, resource schema.GroupVersionResource) bool ClusterHasSynced(clusterID ClusterID) bool ClusterSyncMap(clusterID ClusterID) map[ResourceUnit]bool AllSynced() bool }
func NewGlobalInformer ¶
func NewGlobalInformer(scheme *runtime.Scheme) GlobalInformer
type KubeClient ¶
type KubeClient struct { *kube.ClientImpl // contains filtered or unexported fields }
type ListConfig ¶
type ListOption ¶
type ListOption[T runtime.Object] func(config *ListConfig[T])
func FromMetaListOptions ¶
func FromMetaListOptions[T runtime.Object](opts metav1.ListOptions) (res []ListOption[T])
func InNamespaces ¶
func InNamespaces[T runtime.Object](namespaces ...string) ListOption[T]
func WithCustomFilter ¶
func WithCustomFilter[T runtime.Object](fn FilterFunction[T]) ListOption[T]
func WithCustomPreFilter ¶
func WithCustomPreFilter[T runtime.Object](fn PreFilterFunction) ListOption[T]
func WithLabelSelector ¶
func WithLabelSelector[T runtime.Object](selector labels.Selector) ListOption[T]
func WithLabelSelectorStr ¶
func WithLabelSelectorStr[T runtime.Object](selector string) (opt ListOption[T], err error)
func WithLabelsMap ¶
func WithLabelsMap[T runtime.Object](m map[string]string) ListOption[T]
func WithMetaLabelSelector ¶
func WithMetaLabelSelector[T runtime.Object](selector *metav1.LabelSelector) (opt ListOption[T], err error)
func WithOwnerReference ¶
func WithOwnerReference[T runtime.Object](gvk schema.GroupVersionKind, name string) ListOption[T]
func WithPagination ¶
func WithPagination[T runtime.Object](less func(a, b *unstructured.Unstructured) bool, offset, limit int, totalCount *int) ListOption[T]
type PreFilterFunction ¶
type PreFilterFunction func(obj *unstructured.Unstructured) bool
type ResourceBuilder ¶
type ResourceBuilder[T runtime.Object] interface { // resource type ForResource(gvr schema.GroupVersionResource) ResourceBuilder[T] ForKind(gvk schema.GroupVersionKind) ResourceBuilder[T] // include clusters Clusters(clusters ...ClusterID) ResourceBuilder[T] AllClusters() ResourceBuilder[T] // lister List(opts ...ListOption[T]) (list []T, err error) Get(namespace, name string) (obj T, err error) }
func NewResourceBuilder ¶
func NewResourceBuilder[T runtime.Object](gi GlobalInformer) ResourceBuilder[T]
type ResourceUnit ¶
type ResourceUnit struct { Namespace string // leave empty to watch all namespaces Resource schema.GroupVersionResource }
type ResourceUnitWithHandlers ¶
type ResourceUnitWithHandlers struct { ResourceUnit ResourceEventHandlers []ClusterResourceEventHandler WatchErrorHandlers []ClusterWatchErrorHandler }
func BuildResourceUnitWithHandlersSlice ¶
func BuildResourceUnitWithHandlersSlice(units []ResourceUnit) (res []ResourceUnitWithHandlers)
Click to show internal directories.
Click to hide internal directories.