watcher

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CREATED = iota
	UPDATED
	DELETED
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Watcher

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

func NewWatcher

func NewWatcher(ctx context.Context, client dynamic.Interface, action func(action int, obj *unstructured.Unstructured, old *unstructured.Unstructured)) *Watcher

func (*Watcher) Add

func (*Watcher) GetResources

func (w *Watcher) GetResources(resource string, namespace string) []*unstructured.Unstructured

GetResources return all resources with the same namespace or for all namespaces if namespace=""

For a namespace resource (like pods), only resources for this namespace are returned if a namespace is provided, else all resources for all namespaces are returned. For a cluster resource (like clusterroles), all resources are returned, as the namespace should be empty.

func (*Watcher) LockResource

func (w *Watcher) LockResource(resource string)

func (*Watcher) UnlockResource

func (w *Watcher) UnlockResource(resource string)

Jump to

Keyboard shortcuts

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