intents

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2021 License: Apache-2.0, MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NodeName is a suitable reusable NodeName that may be provided by callers.
	NodeName = "intents-node"
)

Variables

View Source
var (
	Stabilized = ret("Stabilized", intent.Intent{
		Wanted: marker.NodeActionStabilize,
		Active: marker.NodeActionStabilize,
		State:  marker.NodeStateReady,
	})

	Stabilizing = ret("Stabilizing", intent.Intent{
		Wanted: marker.NodeActionStabilize,
		Active: marker.NodeActionStabilize,
		State:  marker.NodeStateBusy,
	})

	PendingStabilizing = ret("PendingStabilizing", intent.Intent{
		Wanted: marker.NodeActionStabilize,
		Active: marker.NodeActionUnknown,
		State:  marker.NodeStateUnknown,
	})

	BusyRebootUpdate = ret("PendingRebootUpdate", intent.Intent{
		Wanted: marker.NodeActionRebootUpdate,
		Active: marker.NodeActionRebootUpdate,
		State:  marker.NodeStateBusy,
	}, WithUpdateAvailable())

	PendingRebootUpdate = ret("PendingRebootUpdate", intent.Intent{
		Wanted: marker.NodeActionRebootUpdate,
		Active: marker.NodeActionPrepareUpdate,
		State:  marker.NodeStateReady,
	})

	UpdateError = ret("UpdateError", intent.Intent{
		Wanted: marker.NodeActionRebootUpdate,
		Active: marker.NodeActionRebootUpdate,
		State:  marker.NodeStateError,
	}, WithUpdateAvailable())

	UpdateSuccess = ret("UpdateSuccess", intent.Intent{
		Wanted: marker.NodeActionRebootUpdate,
		Active: marker.NodeActionRebootUpdate,
		State:  marker.NodeStateReady,
	}, WithUpdateAvailable(marker.NodeUpdateUnknown))

	UpdatePrepared = ret("UpdatePrepared", intent.Intent{
		Wanted: marker.NodeActionPrepareUpdate,
		Active: marker.NodeActionPrepareUpdate,
		State:  marker.NodeStateReady,
	}, WithUpdateAvailable())

	PendingPrepareUpdate = ret("PendingPrepareUpdate", intent.Intent{
		Wanted: marker.NodeActionPrepareUpdate,
		Active: marker.NodeActionStabilize,
		State:  marker.NodeStateReady,
	}, WithUpdateAvailable())

	PreparingUpdate = ret("PendingPrepareUpdate", intent.Intent{
		Wanted: marker.NodeActionPrepareUpdate,
		Active: marker.NodeActionPrepareUpdate,
		State:  marker.NodeStateBusy,
	}, WithUpdateAvailable())

	UpdatePerformed = ret("UpdatePerformed", intent.Intent{
		Wanted: marker.NodeActionPerformUpdate,
		Active: marker.NodeActionPerformUpdate,
		State:  marker.NodeStateReady,
	}, WithUpdateAvailable())

	PerformingUpdate = ret("PerformingUpdate", intent.Intent{
		Wanted: marker.NodeActionPerformUpdate,
		Active: marker.NodeActionPerformUpdate,
		State:  marker.NodeStateBusy,
	}, WithUpdateAvailable())

	PendingUpdate = ret("PendingUpdate", intent.Intent{
		Wanted: marker.NodeActionPerformUpdate,
		Active: marker.NodeActionPrepareUpdate,
		State:  marker.NodeStateReady,
	}, WithUpdateAvailable())

	Unknown = ret("Unknown", intent.Intent{
		Wanted: marker.NodeActionUnknown,
		Active: marker.NodeActionUnknown,
		State:  marker.NodeStateUnknown,
	}, WithUpdateAvailable())

	Reset = ret("Reset", intent.Intent{}, WithReset())
)

Functions

func NextAs

func NextAs(next *intent.Intent) func(*intent.Intent)

Use the provided intent as the targeted next NodeAction.

func NormalizeNodeName

func NormalizeNodeName(name string, is ...*intent.Intent)

NormalizeNodeName makes all provided intents' NodeName uniform for comparison or otherwise normalized expectations.

func Pending

func Pending(wanted marker.NodeAction) func(*intent.Intent)

Set the intent to be pending the provided NodeAction.

func WithBusy

func WithBusy() func(i *intent.Intent)

WithBusy marks the intent as busy with the Active intent.

func WithNodeName

func WithNodeName(name string) func(i *intent.Intent)

WithNodeName sets the intent's NodeName.

func WithReset

func WithReset() func(i *intent.Intent)

WithReset resets the provided intent to the initial state.

func WithUpdateAvailable

func WithUpdateAvailable(up ...marker.NodeUpdate) func(i *intent.Intent)

WithUpdateAvailable marks the intent with the provided NodeUpdate marker.

Types

This section is empty.

Jump to

Keyboard shortcuts

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