activity

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NameInjectExpectation         = "InjectExpectation"
	NamePowerControl              = "PowerControl"
	NameGetPowerStatus            = "GetPowerStatus"
	NameUpdateTaskStatus          = "UpdateTaskStatus"
	NameFirmwareControl           = "FirmwareControl"
	NameGetFirmwareStatus         = "GetFirmwareStatus"
	NameBringUpControl            = "BringUpControl"
	NameGetBringUpStatus          = "GetBringUpStatus"
	NameVerifyFirmwareConsistency = "VerifyFirmwareConsistency"
)

Canonical Temporal activity names. These constants are the single source of truth: used in All() for worker registration and when scheduling via workflow.ExecuteActivity.

Variables

This section is empty.

Functions

This section is empty.

Types

type Activities

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

Activities holds the per-manager-instance dependencies for all Temporal activities. Construct one via New and pass its methods to each Temporal worker via RegisterActivityWithOptions. Because each Activities instance is independent, multiple managers can coexist in the same process without sharing mutable state.

func New

func New(
	updater task.TaskStatusUpdater,
	registry *componentmanager.Registry,
) *Activities

New creates an Activities instance bound to the given status updater and component manager registry. Either argument may be nil; activity calls that require the missing dependency will return an error at invocation time.

func (*Activities) All

func (a *Activities) All() map[string]any

All returns a map of Temporal activity name to bound method for worker registration via RegisterActivityWithOptions. Each entry is a bound method that captures this Activities instance, so its dependencies are isolated from other Activities instances.

func (*Activities) BringUpControl

func (a *Activities) BringUpControl(
	ctx context.Context,
	target common.Target,
) error

BringUpControl opens the power-on gate for the target components.

func (*Activities) FirmwareControl

func (a *Activities) FirmwareControl(
	ctx context.Context,
	target common.Target,
	info operations.FirmwareControlTaskInfo,
) error

FirmwareControl initiates firmware update without waiting for completion. This activity returns immediately after the update request is accepted.

func (*Activities) GetBringUpStatus

func (a *Activities) GetBringUpStatus(
	ctx context.Context,
	target common.Target,
) (*GetBringUpStatusResult, error)

GetBringUpStatus returns the bring-up state for target components.

func (*Activities) GetFirmwareStatus

func (a *Activities) GetFirmwareStatus(
	ctx context.Context,
	target common.Target,
) (*GetFirmwareStatusResult, error)

GetFirmwareStatus returns the current status of firmware updates. This activity is designed to be called repeatedly in a polling loop.

func (*Activities) GetPowerStatus

func (a *Activities) GetPowerStatus(
	ctx context.Context,
	target common.Target,
) (map[string]operations.PowerStatus, error)

GetPowerStatus is a Temporal activity that queries current power states for all components in the target. Returns a map of component ID to PowerStatus.

func (*Activities) InjectExpectation

func (a *Activities) InjectExpectation(
	ctx context.Context,
	target common.Target,
	info operations.InjectExpectationTaskInfo,
) error

InjectExpectation is a Temporal activity that registers expected component configurations with the appropriate component manager service.

func (*Activities) PowerControl

func (a *Activities) PowerControl(
	ctx context.Context,
	target common.Target,
	info operations.PowerControlTaskInfo,
) error

PowerControl is a Temporal activity that applies a power state transition to the target components via the appropriate component manager.

func (*Activities) UpdateTaskStatus

func (a *Activities) UpdateTaskStatus(
	ctx context.Context,
	arg *task.TaskStatusUpdate,
) error

UpdateTaskStatus is a Temporal activity that updates task status by ID.

func (*Activities) VerifyFirmwareConsistency

func (a *Activities) VerifyFirmwareConsistency(
	ctx context.Context,
	target common.Target,
) error

VerifyFirmwareConsistency checks that all target components report the same firmware version set. Only supported by component managers that implement FirmwareConsistencyChecker.

type GetBringUpStatusResult

type GetBringUpStatusResult struct {
	// States maps each component ID to its current bring-up state.
	States map[string]operations.MachineBringUpState
}

GetBringUpStatusResult is the result of GetBringUpStatus activity.

type GetFirmwareStatusResult

type GetFirmwareStatusResult struct {
	// Statuses maps each component ID to its current firmware update state.
	Statuses map[string]operations.FirmwareUpdateStatus
}

GetFirmwareStatusResult is the result of GetFirmwareStatus activity.

Jump to

Keyboard shortcuts

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