Documentation ¶
Index ¶
- type K8sStore
- func (k *K8sStore) AddResource(obj interface{})
- func (k *K8sStore) AddResourceList(lstRuntime []runtime.Object)
- func (k *K8sStore) AppendNewObject(resource k8sresources.K8sResource) error
- func (k *K8sStore) DeleteResource(obj interface{})
- func (k *K8sStore) DumpFullState() error
- func (k *K8sStore) UpdateResource(oldObj, newObj interface{})
- type ResourceWatcher
- type StoreConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type K8sStore ¶
type K8sStore struct {
// contains filtered or unexported fields
}
K8sStore stores the current state of k8s resources
func NewK8sStore ¶
func NewK8sStore(cfg watchConfig, storeConfig StoreConfig) (K8sStore, error)
NewK8sStore creates a new store
func (*K8sStore) AddResource ¶
func (k *K8sStore) AddResource(obj interface{})
AddResource adds a new k8s object to the store
func (*K8sStore) AddResourceList ¶
AddResourceList clears current state add the objects to the store. It will trigger a full dump
func (*K8sStore) AppendNewObject ¶
func (k *K8sStore) AppendNewObject(resource k8sresources.K8sResource) error
AppendNewObject appends a new object to the cache dump
func (*K8sStore) DeleteResource ¶
func (k *K8sStore) DeleteResource(obj interface{})
DeleteResource removes an existing k8s object to the store
func (*K8sStore) DumpFullState ¶
DumpFullState writes the full state to the cache file
func (*K8sStore) UpdateResource ¶
func (k *K8sStore) UpdateResource(oldObj, newObj interface{})
UpdateResource update an existing k8s object
type ResourceWatcher ¶
type ResourceWatcher struct {
// contains filtered or unexported fields
}
func NewResourceWatcher ¶
func NewResourceWatcher(namespace string, config *restclient.Config) ResourceWatcher
NewResourceWatcher creates a new resource watcher on a given cluster
func (*ResourceWatcher) GetWatchConfigs ¶
func (r *ResourceWatcher) GetWatchConfigs(nodePollingPeriod time.Duration, namespacePollingPeriod time.Duration) []watchConfig
GetWatchConfigs creates the list of k8s to watch
func (*ResourceWatcher) Start ¶
func (r *ResourceWatcher) Start(parentCtx context.Context, cfg watchConfig, storeConfig StoreConfig) error
Start begins the watch/poll of a given k8s resource
func (*ResourceWatcher) Stop ¶
func (r *ResourceWatcher) Stop()
Stop closes the watch/poll process of a k8s resource