Documentation
¶
Index ¶
- type ActionsClientInterface
- type ActionsService
- func (s *ActionsService) Abort(ctx context.Context, req *connect.Request[actions.AbortRequest]) (*connect.Response[actions.AbortResponse], error)
- func (s *ActionsService) Enqueue(ctx context.Context, req *connect.Request[actions.EnqueueRequest]) (*connect.Response[actions.EnqueueResponse], error)
- func (s *ActionsService) GetLatestState(ctx context.Context, req *connect.Request[actions.GetLatestStateRequest]) (*connect.Response[actions.GetLatestStateResponse], error)
- func (s *ActionsService) Update(ctx context.Context, req *connect.Request[actions.UpdateRequest]) (*connect.Response[actions.UpdateResponse], error)
- func (s *ActionsService) WatchForUpdates(ctx context.Context, req *connect.Request[actions.WatchForUpdatesRequest], ...) error
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 ¶
func (s *ActionsService) Abort( ctx context.Context, req *connect.Request[actions.AbortRequest], ) (*connect.Response[actions.AbortResponse], error)
Abort aborts a queued or running action, cascading to descendants.
func (*ActionsService) Enqueue ¶
func (s *ActionsService) Enqueue( ctx context.Context, req *connect.Request[actions.EnqueueRequest], ) (*connect.Response[actions.EnqueueResponse], error)
Enqueue queues a new action for execution.
func (*ActionsService) GetLatestState ¶
func (s *ActionsService) GetLatestState( ctx context.Context, req *connect.Request[actions.GetLatestStateRequest], ) (*connect.Response[actions.GetLatestStateResponse], error)
GetLatestState returns the latest state of an action.
func (*ActionsService) Update ¶
func (s *ActionsService) Update( ctx context.Context, req *connect.Request[actions.UpdateRequest], ) (*connect.Response[actions.UpdateResponse], error)
Update updates the status of an action and saves its serialized state.
func (*ActionsService) WatchForUpdates ¶
func (s *ActionsService) WatchForUpdates( ctx context.Context, req *connect.Request[actions.WatchForUpdatesRequest], stream *connect.ServerStream[actions.WatchForUpdatesResponse], ) error
WatchForUpdates watches for updates to the state of actions.
Click to show internal directories.
Click to hide internal directories.