Documentation ¶
Index ¶
Constants ¶
View Source
const (
ForeignKeyViolationErrorCode = pq.ErrorCode("23503")
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PipelineStore ¶
type PipelineStore interface { // pipelines GetById(context context.Context, id int) (pipeline models.PipelineSummery, err error) DeleteExecution(context context.Context, id int) (err error) DeletePipeline(context context.Context, accountId, name, projectName string) (err error) GetPipelineId(context context.Context, accountId, name, projectId string) (id int, err error) GetPipelineIdByExecution(context context.Context, executionId int) (id int, err error) GetAllTemplateChildren(context context.Context, accountId, project, name string) (pipelines []models.Pipeline, err error) // Create pipelineStore a new pipeline Create(context context.Context, base *models.Pipeline, pipeline *models.PipelineVersion, isTemplate bool, isInteraction bool, projectName string, parent_id int, createdFor string) error // todo: return the endpoint // Get All pipelines for accountId GetPipelines(context context.Context, accountId string) ([]models.Pipeline, error) // Get All pipelines of a project in the account ListProjectPipelines(context context.Context, accountId, projectName string) ([]models.Pipeline, error) // Retrieve a pipeline based on name GetByName(context context.Context, accountId string, name, project_name string) (pipeline models.PipelineSummery, err error) // Retrieve a pipeline based on endpoint GetPipelineByEndpoint(context context.Context, endpoint string) (pipeline models.PipelineSummery, err error) // Check if the endpoint is valid return the pipeline id // TODO: should not use accountId, endpoint is enough GetPipelineIdByEndpoint(context context.Context, accountId string, endpoint string) (int, error) GetPipelineNameById(context context.Context, accountId string, pipelineId int) (pipelineName string, err error) // Set the access of an interaction to public or private (true or false) SetInteractionAccess(pipelineId string, isPublic bool) (err error) // Set the user groups allowed to access an interaction SetUserGroups(pipelineId string, userGroups []string) (err error) // tasks GetNumberOfTasksForPipeline(context context.Context, pipelineId int) (count int, err error) GetTaskByPipelineId(context context.Context, pipelineVersionId int, taskName string) (id int, err error) GetTasksWithStatusForExecution(noContext context.Context, executionId int) ([]models.TaskStatusSummery, error) GetTaskNameById(noContext context.Context, taskId int) (string, error) // Get task details based on execution id and task id GetTaskByExecution(context context.Context, executionId int, taskId int) (task models.TaskDetails, err error) GetTaskResultDetails(context context.Context, executionId int, taskId int) (res interface{}, err error) GetNumberOfRunningTasks(context context.Context, executionId int) (count int, err error) // Set the status of a task to timed out if it's status is not already set SetTaskStatusToTimedout(context context.Context, executionId int, taskId int) (err error) // Set the result of a task SetTaskStatus(context context.Context, executionId int, taskId int, status string) (err error) SetTaskResultDetails(context context.Context, executionId int, taskId int, status string, returnValue models.ReturnValueMap, log string) (err error) // executions GetNumberOfExecutions(context context.Context, pipelineId int) (id int, err error) GetAllExecutions(context context.Context, pipelineId int) ([]models.Execution, error) GetLastExecution(context context.Context, pipelineId int) (id int, err error) GetExecutionDetailes(context context.Context, executionId int) (models.Execution, error) SetExecutionTime(executionId, seconds int) error // Add execution CreateExecution(context context.Context, execution models.Execution) (id int, err error) GetThirdPartyAccountId(context context.Context, executionId int) (string, error) // Get initial job of an execution GetInitialTask(context context.Context, executionId int) (taskId int, err error) // GetInitialData retrieves the initial data of an execution GetInitialData(context context.Context, executionId int) (InitialData models.InputData, err error) UpdateInitialData(context context.Context, execId int, initialData models.InputData) error // Get next job in an execution based on the status of a task in the execution GetNextTasks(context context.Context, executionId int, taskId int, status string) (taskIds []int, err error) ActivatePipeline(context context.Context, accountId, pipelineId string) error DeActivatePipeline(context context.Context, accountId, pipelineId string) error GetAccountIdByExecutionId(context context.Context, executionId int) (string, error) // Deletes all the pipelines in the project DeleteAllPipelines(context context.Context, accountId, projectName string) (err error) }
NOTE: Many of these endpoints don't get accountId as one of their inputs meaning they don't check if the operation is being performed on the jwt token subject's own data or not, this is a BIG VULNERABILITY fix it
func New ¶
func New(db *db.DB) PipelineStore
Source Files ¶
- activation.go
- create_pipeline.go
- delete_all_pipelines.go
- delete_execution.go
- delete_pipeline.go
- error_codes.go
- execution_create.go
- get_accountId.go
- get_all_children.go
- get_all_executions.go
- get_all_pipelines.go
- get_execution_task.go
- get_initial_data.go
- get_initial_task.go
- get_last_execution_for_pipeline.go
- get_next_tasks.go
- get_number_of_tasks.go
- get_pipeline_by_endpoint.go
- get_pipeline_id.go
- get_pipeline_id_by_endpoint.go
- get_pipeline_id_by_execution.go
- get_task_by_pipeline_id.go
- get_task_name_by_id.go
- get_tasks_with_status_for_execution.go
- list_project_pipelines.go
- pipeline_store.go
- pipeline_store_get.go
- pipeline_store_get_by_id.go
- set_execution_time.go
- set_interaction_access.go
- set_user_groups.go
- task_status_and_result.go
Click to show internal directories.
Click to hide internal directories.