monitor

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2025 License: Apache-2.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertNamespaceFn

func AssertNamespaceFn(
	ctx context.Context,
	logger *slog.Logger,
	kube k8s.Interface,
	namespace string,
) (monitorQueueFn, error)

AssertNamespaceFn returns a function that asserts if the informed namespace exists, otherwise returns error.

Types

type Interface

type Interface interface {
	// Collect collects relevant resources for later inspection.
	Collect(context.Context, *resource.Info) error

	// Watch waits for all monitoring functions to complete, or until the timeout
	// is reached.
	Watch(time.Duration) error
}

Interface is the interface that defines the methods of a Monitor.

type Monitor

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

Monitor is the monitoring actor which collects interesting resources from a Helm Chart release payload, and monitors them until they are ready. The monitoring is executed with a queue of functions, which are executed in order until the queue is empty or timeout is reached.

func NewMonitor

func NewMonitor(logger *slog.Logger, kube k8s.Interface) *Monitor

NewMonitor instantiates a new Monitor.

func (*Monitor) Collect

func (m *Monitor) Collect(ctx context.Context, r *resource.Info) error

Collect inspects the resource and adds a monitoring function to the queue.

func (*Monitor) Watch

func (m *Monitor) Watch(timeout time.Duration) error

Watch waits for all monitoring functions to complete, or until the timeout is reached. Returns error if the queue is not empty after timeout.

Jump to

Keyboard shortcuts

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