loop

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ControlFunction

type ControlFunction interface {
	// Get information from the environment
	Sense()

	// Compare the measured data with the intended state.
	// Do not affect the environment here, if possible.
	// If *true* there was a discrepancy and the next stage will be executed, else skipped
	Compare() bool

	// Do an action to get the system into alignment with the desired state
	Respond()

	// Return the description of the CF
	Describe() string

	// Release & Cleanup the resources created by this CF.
	// Return *true* if the cleanup was successful or is not needed.
	// If a CF returns false, the cleanup will be reattempted several times,
	// mostly in case other CFs have to do their cleanup first.
	// Warning: This function may be executed multiple times even if it returned *true*.
	Cleanup() bool
}

Defines an interface for a component responsible for some part of the reconciliation

type ControlLoop

type ControlLoop interface {
	AddControlFunction(cf ControlFunction)

	GetControlFunctions() []ControlFunction

	GetContext() context.LoopContext

	Run()

	Cleanup()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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