Help us shape the future of Go! Take the 2026 Go Developer Survey

observe

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ObserveResource

func ObserveResource(ctx context.Context, log logr.Logger, client *dynamic.DynamicClient, gvr schema.GroupVersionResource, resourceC chan<- *ResourceObservation)

ObserveResource monitors a Kubernetes resource for changes

Types

type ObservationSink

type ObservationSink func(ctx context.Context, log logr.Logger, resourceC <-chan *ResourceObservation) chan struct{}

type ObservationSource

type ObservationSource func(ctx context.Context, log logr.Logger, resourceC chan<- *ResourceObservation) chan struct{}

func Source

func Source(log logr.Logger, enableEvents bool) (ObservationSource, error)

type ObservationType

type ObservationType string
const (
	ObservationTypeAdd    ObservationType = "add"
	ObservationTypeUpdate ObservationType = "update"
	ObservationTypeDelete ObservationType = "delete"
)

type ResourceObservation

type ResourceObservation struct {
	Group    string `json:"group"`
	Version  string `json:"version"`
	Resource string `json:"resource"`

	UID types.UID `json:"uid"`

	Object    *unstructured.Unstructured `json:"object,omitempty"`
	OldObject *unstructured.Unstructured `json:"oldObject,omitempty"`

	ObservationType ObservationType `json:"observationType"`
	ObservationTime time.Time       `json:"observationTime"`
}

Jump to

Keyboard shortcuts

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