activity

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: Apache-2.0 Imports: 8 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 added in v1.4.0

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 added in v1.4.0

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 added in v1.4.0

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 added in v1.4.0

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

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

func (*Activities) FirmwareControl added in v1.4.0

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 added in v1.4.0

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

GetBringUpStatus returns the bring-up state for target components.

func (*Activities) GetFirmwareStatus added in v1.4.0

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 added in v1.4.0

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 added in v1.4.0

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 added in v1.4.0

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 added in v1.4.0

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 added in v1.4.0

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 added in v1.2.0

type GetBringUpStatusResult struct {
	States map[string]operations.MachineBringUpState
}

GetBringUpStatusResult is the result of GetBringUpStatus activity.

type GetFirmwareStatusResult added in v1.2.0

type GetFirmwareStatusResult struct {
	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