Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrWorkflowRunNotFound = errors.New("workflow run not found") ErrWorkflowRunAlreadyExists = errors.New("workflow run already exists") ErrWorkflowNotFound = errors.New("workflow not found") ErrWorkflowRunReferenceNotFound = errors.New("workflow run reference not found") ErrInvalidCommitSHA = errors.New("invalid commit SHA format") )
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service interface {
CreateWorkflowRun(ctx context.Context, namespaceName string, wfRun *openchoreov1alpha1.WorkflowRun) (*openchoreov1alpha1.WorkflowRun, error)
UpdateWorkflowRun(ctx context.Context, namespaceName string, wfRun *openchoreov1alpha1.WorkflowRun) (*openchoreov1alpha1.WorkflowRun, error)
ListWorkflowRuns(ctx context.Context, namespaceName, projectName, componentName, workflowName string, opts services.ListOptions) (*services.ListResult[openchoreov1alpha1.WorkflowRun], error)
GetWorkflowRun(ctx context.Context, namespaceName, runName string) (*openchoreov1alpha1.WorkflowRun, error)
GetWorkflowRunStatus(ctx context.Context, namespaceName, runName string) (*models.WorkflowRunStatusResponse, error)
GetWorkflowRunLogs(ctx context.Context, namespaceName, runName, taskName string, sinceSeconds *int64) ([]models.WorkflowRunLogEntry, error)
GetWorkflowRunEvents(ctx context.Context, namespaceName, runName, taskName string) ([]models.WorkflowRunEventEntry, error)
DeleteWorkflowRun(ctx context.Context, namespaceName, runName string) error
// TriggerWorkflow creates a WorkflowRun from a component's workflow configuration.
// The authorized version is used by API handlers; the unauthz version is used by webhook processing.
TriggerWorkflow(ctx context.Context, namespaceName, projectName, componentName, commit string) (*models.WorkflowRunTriggerResponse, error)
}
Service defines the workflow run service interface.
func NewService ¶
func NewService(k8sClient client.Client, planeClientProvider kubernetesClient.WorkflowPlaneClientProvider, gwClient *gatewayClient.Client, logger *slog.Logger) Service
NewService creates a new workflow run service without authorization.
func NewServiceWithAuthz ¶
func NewServiceWithAuthz(k8sClient client.Client, planeClientProvider kubernetesClient.WorkflowPlaneClientProvider, gwClient *gatewayClient.Client, authzPDP authz.PDP, logger *slog.Logger) Service
NewServiceWithAuthz creates a workflow run service with authorization checks.
Click to show internal directories.
Click to hide internal directories.