storage

package
v0.0.0-...-f67acb1 Latest Latest
Warning

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

Go to latest
Published: May 11, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

package storage informs the factory for creating storage. the kubernetes factory is responsible for setting up the necessary storage for interacting with the API server. The runtime storage package sets up and initializes global storage that is necessary for working against data used in the active runtime environment, including live clients, informers, and other runtime-specific objects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLocalStore

func NewLocalStore(filename string) *localStorage

NewLocalStore returns a localStore instance.

Types

type ClusterRuntimeStorage

type ClusterRuntimeStorage struct {
	// Client is the client for interacting with the API server for a given cluster.
	Client dynamic.Interface

	// ClusterInformer is the informer for non-namespaced objects in the cluster.
	ClusterInformer dynamicinformer.DynamicSharedInformerFactory

	// NamespaceInformers is a map of informers for namespaced objects in the cluster, keyed by namespace.
	// This is used to reduce the number of informers that are running at any given time, and to reduce the number of
	// informers that are started and stopped as namespaces are added and removed.
	NamespaceInformers map[string]dynamicinformer.DynamicSharedInformerFactory
	// contains filtered or unexported fields
}

type RuntimeStorage

type RuntimeStorage struct {
	// Clusters is a per-cluster storage object that contains all the necessary informers and clients for interacting with the
	// API server for a given cluster.
	Clusters map[string]*ClusterRuntimeStorage
}

func NewRuntimeStorage

func NewRuntimeStorage() *RuntimeStorage

func (*RuntimeStorage) GetClusterInformer

func (rs *RuntimeStorage) GetClusterInformer(cluster string) (dynamicinformer.DynamicSharedInformerFactory, error)

GetClusterInformer returns the cluster informer for a given cluster.

func (*RuntimeStorage) GetNamespaceInformer

func (rs *RuntimeStorage) GetNamespaceInformer(cluster string, namespace string) (dynamicinformer.DynamicSharedInformerFactory, error)

GetNamespaceInformer returns the namespace informer for a given namespace in a given cluster.

func (*RuntimeStorage) InitializeCluster

func (rs *RuntimeStorage) InitializeCluster(cluster string, client dynamic.Interface, clusterInformer dynamicinformer.DynamicSharedInformerFactory) error

InitializeCluster initializes the cluster storage for a given cluster. It adds the client for the cluster, as well as the informers for the cluster and all it's namespaces. This method should be called once for each cluster that the application is working with.

func (*RuntimeStorage) RemoveClusterInformer

func (rs *RuntimeStorage) RemoveClusterInformer(cluster string) error

RemoveClusterInformer removes the cluster informer for a given cluster.

func (*RuntimeStorage) RemoveNamespaceInformer

func (rs *RuntimeStorage) RemoveNamespaceInformer(cluster string, namespace string) error

RemoveNamespaceInformer removes the namespace informer for a given namespace in a given cluster.

Jump to

Keyboard shortcuts

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