Documentation
¶
Index ¶
- Variables
- func Create(ctx context.Context, pool *pgxpool.Pool, k8sClient ctrlclient.Client, ...) (workflowdb.Workflow, error)
- func CreateSchedule(ctx context.Context, k8sClient ctrlclient.Client, ns string, agtName string, ...) (gatewayapi.WorkflowSchedule, error)
- func CreateScheduledRun(ctx context.Context, k8sClient ctrlclient.Client, ns string, agtName string, ...) (gatewayapi.WorkflowRunSummary, error)
- func CreateWebhookRun(ctx context.Context, k8sClient ctrlclient.Client, ns string, agtName string, ...) (gatewayapi.WorkflowRunSummary, error)
- func DeleteMany(ctx context.Context, pool *pgxpool.Pool, k8sClient ctrlclient.Client, ...) error
- func DeleteRun(ctx context.Context, k8sClient ctrlclient.Client, ns string, agtName string, ...) error
- func DeleteSchedule(ctx context.Context, k8sClient ctrlclient.Client, ns string, agtName string, ...) error
- func Get(ctx context.Context, pool *pgxpool.Pool, tenantNamespace string, ...) (gatewayapi.Workflow, error)
- func ListRuns(ctx context.Context, k8sClient ctrlclient.Client, ns string, agtName string, ...) ([]gatewayapi.WorkflowRunSummary, int, error)
- func ListSchedules(ctx context.Context, k8sClient ctrlclient.Client, ns string, agtName string, ...) ([]gatewayapi.WorkflowSchedule, int, error)
- func ListSummaries(ctx context.Context, pool *pgxpool.Pool, tenantNamespace string, ...) ([]gatewayapi.WorkflowSummary, error)
- func ListWebhookTriggers(ctx context.Context, k8sClient ctrlclient.Client, ns string, agtName string, ...) ([]gatewayapi.WorkflowWebhookTrigger, int, error)
- func LockDefinitions(ctx context.Context, tx pgx.Tx, ns, agentName string, names []string) ([]workflowdb.WorkflowLockDefinitionsRow, error)
- func MapGetError(err error) *apiutil.APIError
- func MapMutationError(err error) *apiutil.APIError
- func PatchRunNodeStatus(ctx context.Context, pool *pgxpool.Pool, k8sClient ctrlclient.Client, ...) error
- func PatchRunStatus(ctx context.Context, k8sClient ctrlclient.Client, ns string, agtName string, ...) error
- func RequireUnlocked(rows []workflowdb.WorkflowLockDefinitionsRow) error
- func RunDetail(run *agentzv1alpha1.WorkflowRun) gatewayapi.WorkflowRunDetail
- func UpdateSchedule(ctx context.Context, k8sClient ctrlclient.Client, ns string, agtName string, ...) (gatewayapi.WorkflowSchedule, error)
- func ValidateAgentScheduleList(agtName string) []gatewayapi.FieldError
- func ValidateCreateRequest(agtName string, req gatewayapi.CreateWorkflowRequest) ([]gatewayapi.FieldError, error)
- func ValidateDeleteRequest(agtName string, wfNames []string) []gatewayapi.FieldError
- func ValidateListRequest(agtName string) []gatewayapi.FieldError
- func ValidateLookupRequest(agtName string, wfName string) []gatewayapi.FieldError
- func ValidateNodeName(name string) []gatewayapi.FieldError
- func ValidateRunInputs(ctx context.Context, db workflowdb.DBTX, tenantNamespace string, ...) ([]gatewayapi.FieldError, error)
- func ValidateRunListFilters(params gatewayapi.ListWorkflowRunsParams) []gatewayapi.FieldError
- func ValidateRunListStatus(status *gatewayapi.WorkflowRunStatus) []gatewayapi.FieldError
- func ValidateRunName(name string) []gatewayapi.FieldError
- func ValidateRunNodePatchPhase(phase gatewayapi.WorkflowRunNodePatchPhase) []gatewayapi.FieldError
- func ValidateRunStatusMessage(message string) []gatewayapi.FieldError
- func ValidateRunTerminalPhase(phase gatewayapi.WorkflowRunTerminalPhase) []gatewayapi.FieldError
- func ValidateRunWatchNames(runNames *[]gatewayapi.WorkflowRunName) []gatewayapi.FieldError
- func ValidateScheduleCreateRequest(agtName string, wfName string, req *gatewayapi.CreateWorkflowScheduleRequest) []gatewayapi.FieldError
- func ValidateScheduleInputs(ctx context.Context, tx pgx.Tx, ns, agentName, workflowName string, ...) ([]gatewayapi.FieldError, error)
- func ValidateScheduleList(agtName string, wfName string) []gatewayapi.FieldError
- func ValidateScheduleLookup(agtName string, wfName string, name string) []gatewayapi.FieldError
- func ValidateScheduleUpdateRequest(agtName string, wfName string, name string, ...) []gatewayapi.FieldError
- type NodePhaseConflictError
- type RunPhaseConflictError
Constants ¶
This section is empty.
Variables ¶
var ( // ErrWorkflowRunTerminal reports an attempted update to a finished run. ErrWorkflowRunTerminal = errors.New("workflow run already has a terminal status") // ErrWorkflowRunNodeNotFound reports a node absent from the workflow graph. ErrWorkflowRunNodeNotFound = errors.New("workflow run node not found") // ErrWorkflowRunScopeMismatch reports a run outside the requested route scope. ErrWorkflowRunScopeMismatch = errors.New("workflow run does not match route scope") )
var ErrScheduleAgentMismatch = errors.New("workflow schedule agent mismatch")
ErrScheduleAgentMismatch reports a schedule outside the requested agent or workflow.
var ErrWorkflowNotFound = errors.New("workflow not found")
ErrWorkflowNotFound reports a missing workflow in the requested agent scope.
Functions ¶
func Create ¶
func Create(ctx context.Context, pool *pgxpool.Pool, k8sClient ctrlclient.Client, tenantNamespace string, agtName string, req gatewayapi.CreateWorkflowRequest) (workflowdb.Workflow, error)
Create stores a workflow and its graph.
func CreateSchedule ¶
func CreateSchedule(ctx context.Context, k8sClient ctrlclient.Client, ns string, agtName string, wfName string, req gatewayapi.CreateWorkflowScheduleRequest, delivery *agentzv1alpha1.WorkflowDelivery) (gatewayapi.WorkflowSchedule, error)
CreateSchedule stores a schedule owned by its agent and returns the stored object.
func CreateScheduledRun ¶
func CreateScheduledRun(ctx context.Context, k8sClient ctrlclient.Client, ns string, agtName string, wfName string, schName string) (gatewayapi.WorkflowRunSummary, error)
CreateScheduledRun creates one run from one workflow schedule.
func CreateWebhookRun ¶
func CreateWebhookRun(ctx context.Context, k8sClient ctrlclient.Client, ns string, agtName string, wfName string, inputs []byte, timeoutSeconds int32, apiKeyID string) (gatewayapi.WorkflowRunSummary, error)
CreateWebhookRun creates one direct workflow run from a webhook request.
func DeleteMany ¶
func DeleteMany(ctx context.Context, pool *pgxpool.Pool, k8sClient ctrlclient.Client, tenantNamespace string, agtName string, wfNames []string) error
DeleteMany removes multiple workflows for one agent.
func DeleteRun ¶
func DeleteRun(ctx context.Context, k8sClient ctrlclient.Client, ns string, agtName string, wfName string, runName string) error
DeleteRun deletes one workflow run.
func DeleteSchedule ¶
func DeleteSchedule(ctx context.Context, k8sClient ctrlclient.Client, ns string, agtName string, wfName string, name string) error
DeleteSchedule removes a schedule after checking its agent and workflow scope.
func Get ¶
func Get(ctx context.Context, pool *pgxpool.Pool, tenantNamespace string, agtName string, wfName string) (gatewayapi.Workflow, error)
Get reconstructs a stored workflow graph from its related workflow tables.
func ListRuns ¶
func ListRuns(ctx context.Context, k8sClient ctrlclient.Client, ns string, agtName string, wfName string, params gatewayapi.ListWorkflowRunsParams, limit int, offset int, destinations map[string]int64) ([]gatewayapi.WorkflowRunSummary, int, error)
ListRuns lists non-evaluation runs for a workflow's trigger history.
func ListSchedules ¶
func ListSchedules(ctx context.Context, k8sClient ctrlclient.Client, ns string, agtName string, wfName string, sortBy gatewayapi.WorkflowScheduleSortByQuery, sortOrder gatewayapi.SortOrderQuery, limit int, offset int, destinations map[string]int64) ([]gatewayapi.WorkflowSchedule, int, error)
ListSchedules returns a sorted page of schedules for an agent and optional workflow.
func ListSummaries ¶
func ListSummaries(ctx context.Context, pool *pgxpool.Pool, tenantNamespace string, agtName string) ([]gatewayapi.WorkflowSummary, error)
ListSummaries returns workflow metadata for one agent without loading nodes or edges.
func ListWebhookTriggers ¶
func ListWebhookTriggers(ctx context.Context, k8sClient ctrlclient.Client, ns string, agtName string, limit int, offset int) ([]gatewayapi.WorkflowWebhookTrigger, int, error)
ListWebhookTriggers lists distinct webhook trigger rows for one agent.
func LockDefinitions ¶ added in v0.34.0
func LockDefinitions(ctx context.Context, tx pgx.Tx, ns, agentName string, names []string) ([]workflowdb.WorkflowLockDefinitionsRow, error)
LockDefinitions serializes workflow mutations against owning-agent deletion. An empty names list selects all workflows; named lookups require every target.
func MapGetError ¶
MapGetError translates workflow read failures to API errors.
func MapMutationError ¶ added in v0.34.0
MapMutationError translates workflow mutation failures to API errors.
func PatchRunNodeStatus ¶
func PatchRunNodeStatus(ctx context.Context, pool *pgxpool.Pool, k8sClient ctrlclient.Client, ns string, agtName string, wfName string, runName string, nodeName string, req gatewayapi.PatchWorkflowRunNodeStatusRequest, msg string) error
PatchRunNodeStatus updates one workflow run node phase.
func PatchRunStatus ¶
func PatchRunStatus(ctx context.Context, k8sClient ctrlclient.Client, ns string, agtName string, wfName string, runName string, req gatewayapi.PatchWorkflowRunStatusRequest, msg string) error
PatchRunStatus updates one running workflow run with a terminal phase.
func RequireUnlocked ¶ added in v0.34.0
func RequireUnlocked(rows []workflowdb.WorkflowLockDefinitionsRow) error
RequireUnlocked rejects destructive operations before any cleanup begins.
func RunDetail ¶ added in v0.33.0
func RunDetail(run *agentzv1alpha1.WorkflowRun) gatewayapi.WorkflowRunDetail
RunDetail projects an already authorized run without fetching a second snapshot.
func UpdateSchedule ¶
func UpdateSchedule(ctx context.Context, k8sClient ctrlclient.Client, ns string, agtName string, wfName string, name string, req gatewayapi.UpdateWorkflowScheduleRequest, delivery *agentzv1alpha1.WorkflowDelivery) (gatewayapi.WorkflowSchedule, error)
UpdateSchedule replaces a schedule specification, retrying concurrent updates.
func ValidateAgentScheduleList ¶
func ValidateAgentScheduleList(agtName string) []gatewayapi.FieldError
ValidateAgentScheduleList checks the agent name used to list its schedules.
func ValidateCreateRequest ¶
func ValidateCreateRequest(agtName string, req gatewayapi.CreateWorkflowRequest) ([]gatewayapi.FieldError, error)
ValidateCreateRequest checks the input contract and connected, acyclic graph.
func ValidateDeleteRequest ¶
func ValidateDeleteRequest(agtName string, wfNames []string) []gatewayapi.FieldError
ValidateDeleteRequest validates one agent-scoped workflow delete request.
func ValidateListRequest ¶
func ValidateListRequest(agtName string) []gatewayapi.FieldError
ValidateListRequest checks the agent name used to list workflows.
func ValidateLookupRequest ¶
func ValidateLookupRequest(agtName string, wfName string) []gatewayapi.FieldError
ValidateLookupRequest checks agent and workflow names used in route lookup.
func ValidateNodeName ¶
func ValidateNodeName(name string) []gatewayapi.FieldError
ValidateNodeName validates one workflow graph node name.
func ValidateRunInputs ¶
func ValidateRunInputs(ctx context.Context, db workflowdb.DBTX, tenantNamespace string, agtName string, wfName string, raw []byte) ([]gatewayapi.FieldError, error)
ValidateRunInputs validates runtime input values for one workflow.
func ValidateRunListFilters ¶
func ValidateRunListFilters(params gatewayapi.ListWorkflowRunsParams) []gatewayapi.FieldError
ValidateRunListFilters validates workflow run trigger filters.
func ValidateRunListStatus ¶
func ValidateRunListStatus(status *gatewayapi.WorkflowRunStatus) []gatewayapi.FieldError
ValidateRunListStatus validates one workflow run phase filter.
func ValidateRunName ¶
func ValidateRunName(name string) []gatewayapi.FieldError
ValidateRunName validates one workflow run resource name.
func ValidateRunNodePatchPhase ¶
func ValidateRunNodePatchPhase(phase gatewayapi.WorkflowRunNodePatchPhase) []gatewayapi.FieldError
ValidateRunNodePatchPhase validates one node status patch phase.
func ValidateRunStatusMessage ¶
func ValidateRunStatusMessage(message string) []gatewayapi.FieldError
ValidateRunStatusMessage validates one terminal status message.
func ValidateRunTerminalPhase ¶
func ValidateRunTerminalPhase(phase gatewayapi.WorkflowRunTerminalPhase) []gatewayapi.FieldError
ValidateRunTerminalPhase validates a terminal WorkflowRun patch phase.
func ValidateRunWatchNames ¶
func ValidateRunWatchNames(runNames *[]gatewayapi.WorkflowRunName) []gatewayapi.FieldError
ValidateRunWatchNames validates run names used by one watch request.
func ValidateScheduleCreateRequest ¶
func ValidateScheduleCreateRequest(agtName string, wfName string, req *gatewayapi.CreateWorkflowScheduleRequest) []gatewayapi.FieldError
ValidateScheduleCreateRequest trims and validates a new schedule definition.
func ValidateScheduleInputs ¶
func ValidateScheduleInputs(ctx context.Context, tx pgx.Tx, ns, agentName, workflowName string, inputs *gatewayapi.JSONValue) ([]gatewayapi.FieldError, error)
ValidateScheduleInputs checks inputs while the caller holds the workflow mutation lock.
func ValidateScheduleList ¶
func ValidateScheduleList(agtName string, wfName string) []gatewayapi.FieldError
ValidateScheduleList checks the agent and workflow names used to list schedules.
func ValidateScheduleLookup ¶
func ValidateScheduleLookup(agtName string, wfName string, name string) []gatewayapi.FieldError
ValidateScheduleLookup checks the names identifying a schedule.
func ValidateScheduleUpdateRequest ¶
func ValidateScheduleUpdateRequest(agtName string, wfName string, name string, req *gatewayapi.UpdateWorkflowScheduleRequest) []gatewayapi.FieldError
ValidateScheduleUpdateRequest trims and validates a replacement schedule.
Types ¶
type NodePhaseConflictError ¶
type NodePhaseConflictError struct {
Node string
Current agentzv1alpha1.WorkflowRunNodePhase
Target agentzv1alpha1.WorkflowRunNodePhase
}
NodePhaseConflictError reports one invalid node phase transition.
func (*NodePhaseConflictError) Error ¶
func (e *NodePhaseConflictError) Error() string
Error identifies the node and its rejected phase transition.
type RunPhaseConflictError ¶
type RunPhaseConflictError struct {
Current agentzv1alpha1.WorkflowRunPhase
Target agentzv1alpha1.WorkflowRunPhase
}
RunPhaseConflictError reports one invalid terminal phase transition.
func (*RunPhaseConflictError) Error ¶
func (e *RunPhaseConflictError) Error() string
Error describes the rejected workflow run transition.