service

package
v2.0.8 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionsClientInterface

type ActionsClientInterface interface {
	// Enqueue creates a TaskAction CR in Kubernetes.
	Enqueue(ctx context.Context, action *actions.Action, runSpec *task.RunSpec) error

	// GetState retrieves the state JSON for a TaskAction.
	GetState(ctx context.Context, actionID *common.ActionIdentifier) (string, error)

	// PutState updates the state and status of a TaskAction.
	PutState(ctx context.Context, actionID *common.ActionIdentifier, attempt uint32, status *workflow.ActionStatus, stateJSON string) error

	// AbortAction aborts a queued or running action, cascading to descendants.
	AbortAction(ctx context.Context, actionID *common.ActionIdentifier, reason *string) error

	// ListChildActions lists all TaskActions that are children of the given parent action.
	ListChildActions(ctx context.Context, parentActionID *common.ActionIdentifier) ([]*executorv1.TaskAction, error)

	// Subscribe creates a new subscription channel for action updates for the given parent action name.
	Subscribe(parentActionName string) chan *k8s.ActionUpdate

	// Unsubscribe removes the given channel from the subscription list for the parent action name.
	Unsubscribe(parentActionName string, ch chan *k8s.ActionUpdate)

	// StartWatching starts watching TaskAction resources.
	StartWatching(ctx context.Context) error

	// StopWatching stops the TaskAction watcher.
	StopWatching()
}

ActionsClientInterface defines the interface for actions operations. This combines the responsibilities of the queue and state clients.

type ActionsService

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

ActionsService implements the ActionsService gRPC API.

func NewActionsService

func NewActionsService(client ActionsClientInterface) *ActionsService

NewActionsService creates a new ActionsService.

func (*ActionsService) Abort

Abort aborts a queued or running action, cascading to descendants.

func (*ActionsService) Enqueue

Enqueue queues a new action for execution.

func (*ActionsService) GetLatestState

GetLatestState returns the latest state of an action.

func (*ActionsService) Update

Update updates the status of an action and saves its serialized state.

func (*ActionsService) WatchForUpdates

WatchForUpdates watches for updates to the state of actions.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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