Documentation ¶
Index ¶
- func CancelPipeline(pipelineId uint64) errors.Error
- func CancelTask(taskId uint64) errors.Error
- func CreateBlueprint(blueprint *models.Blueprint) errors.Error
- func CreateDbPipeline(newPipeline *models.NewPipeline) (*models.DbPipeline, errors.Error)
- func CreateDbProject(project *models.Project) errors.Error
- func CreateDbProjectMetric(projectMetric *models.ProjectMetric) errors.Error
- func CreatePipeline(newPipeline *models.NewPipeline) (*models.Pipeline, errors.Error)
- func CreateProject(project *models.Project) errors.Error
- func CreateProjectMetric(projectMetric *models.ProjectMetric) errors.Error
- func CreateTask(newTask *models.NewTask) (*models.Task, errors.Error)
- func DeleteBlueprint(id uint64) errors.Error
- func DeleteCreatedTasks(pipelineId uint64) errors.Error
- func DeleteDbBlueprint(id uint64) errors.Error
- func ExecuteMigration() errors.Error
- func FlushProjectMetrics(projectName string, baseMetrics *[]models.BaseMetric) errors.Error
- func GeneratePlanJsonV100(settings *models.BlueprintSettings) (core.PipelinePlan, errors.Error)
- func GeneratePlanJsonV200(projectName string, sources *models.BlueprintSettings, ...) (core.PipelinePlan, errors.Error)
- func GetBlueprint(blueprintId uint64) (*models.Blueprint, errors.Error)
- func GetBlueprintByProjectName(projectName string) (*models.Blueprint, errors.Error)
- func GetBlueprints(query *BlueprintQuery) ([]*models.Blueprint, int64, errors.Error)
- func GetDbBlueprint(dbBlueprintId uint64) (*models.DbBlueprint, errors.Error)
- func GetDbBlueprintByProjectName(projectName string) (*models.DbBlueprint, errors.Error)
- func GetDbBlueprints(query *BlueprintQuery) ([]*models.DbBlueprint, int64, errors.Error)
- func GetDbPipeline(pipelineId uint64) (*models.DbPipeline, errors.Error)
- func GetDbPipelines(query *PipelineQuery) ([]*models.DbPipeline, int64, errors.Error)
- func GetDbProject(name string) (*models.Project, errors.Error)
- func GetDbProjectMetric(projectName string, pluginName string) (*models.ProjectMetric, errors.Error)
- func GetDbProjectMetrics(projectName string) (*[]models.ProjectMetric, int64, errors.Error)
- func GetDbProjects(query *ProjectQuery) ([]*models.Project, int64, errors.Error)
- func GetPipeline(pipelineId uint64) (*models.Pipeline, errors.Error)
- func GetPipelineLogger(pipeline *models.Pipeline) core.Logger
- func GetPipelineLogsArchivePath(pipeline *models.Pipeline) (string, errors.Error)
- func GetPipelines(query *PipelineQuery) ([]*models.Pipeline, int64, errors.Error)
- func GetPluginsApiResources() (map[string]map[string]map[string]core.ApiResourceHandler, errors.Error)
- func GetProject(name string) (*models.Project, errors.Error)
- func GetProjectMetric(projectName string, pluginName string) (*models.ProjectMetric, errors.Error)
- func GetProjectMetrics(projectName string) (*[]models.ProjectMetric, int64, errors.Error)
- func GetProjects(query *ProjectQuery) ([]*models.Project, int64, errors.Error)
- func GetRepos() ([]*code.Repo, int64, errors.Error)
- func GetTask(taskId uint64) (*models.Task, errors.Error)
- func GetTasks(query *TaskQuery) ([]models.Task, int64, errors.Error)
- func GetTasksWithLastStatus(pipelineId uint64) ([]models.Task, errors.Error)
- func Init()
- func InsertRow(table string, rows []map[string]interface{}) (int64, errors.Error)
- func LoadBluePrintAndMetrics(projectOutput *models.ApiOutputProject) errors.Error
- func MakePlanForBlueprint(blueprint *models.Blueprint) (core.PipelinePlan, errors.Error)
- func MigrationRequireConfirmation() bool
- func NotifyExternal(pipelineId uint64) errors.Error
- func ParallelizePipelinePlans(plans ...core.PipelinePlan) core.PipelinePlan
- func PatchBlueprint(id uint64, body map[string]interface{}) (*models.Blueprint, errors.Error)
- func PatchBlueprintEnableByProjectName(projectName string, enable bool) (*models.Blueprint, errors.Error)
- func PatchProject(name string, body map[string]interface{}) (*models.ApiOutputProject, errors.Error)
- func PatchProjectMetric(projectName string, pluginName string, body map[string]interface{}) (*models.ProjectMetric, errors.Error)
- func ReloadBlueprints(c *cron.Cron) errors.Error
- func RunPipelineInQueue(pipelineMaxParallel int64)
- func RunTasksStandalone(parentLogger core.Logger, taskIds []uint64) errors.Error
- func SaveDbBlueprint(dbBlueprint *models.DbBlueprint) errors.Error
- func SaveDbProject(project *models.Project) errors.Error
- func SaveDbProjectMetric(projectMetric *models.ProjectMetric) errors.Error
- func SequencializePipelinePlans(plans ...core.PipelinePlan) core.PipelinePlan
- func SpawnTasks(input []models.Task) ([]models.Task, errors.Error)
- func TriggerBlueprint(id uint64) (*models.Pipeline, errors.Error)
- func UpdateDbPipelineStatus(pipelineId uint64, status string) errors.Error
- func WrapPipelinePlans(beforePlanJson json.RawMessage, mainPlan core.PipelinePlan, ...) (core.PipelinePlan, errors.Error)
- type BlueprintQuery
- type NotificationService
- type PipelineNotification
- type PipelineQuery
- type ProjectQuery
- type RunningTask
- func (rt *RunningTask) Add(taskId uint64, cancel context.CancelFunc) errors.Error
- func (rt *RunningTask) FillProgressDetailToTasks(tasks []models.Task)
- func (rt *RunningTask) GetProgressDetail(taskId uint64) *models.TaskProgressDetail
- func (rt *RunningTask) Remove(taskId uint64) (context.CancelFunc, errors.Error)
- type RunningTaskData
- type TaskQuery
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateBlueprint ¶
CreateBlueprint accepts a Blueprint instance and insert it to database
func CreateDbPipeline ¶ added in v0.14.0
func CreateDbPipeline(newPipeline *models.NewPipeline) (*models.DbPipeline, errors.Error)
CreateDbPipeline returns a NewPipeline
func CreateDbProject ¶
CreateDbProject accepts a project instance and insert it to database
func CreateDbProjectMetric ¶
func CreateDbProjectMetric(projectMetric *models.ProjectMetric) errors.Error
CreateDbProjectMetric accepts a project metric instance and insert it to database
func CreatePipeline ¶
CreatePipeline and return the model
func CreateProject ¶ added in v0.15.0
CreateProject accepts a project instance and insert it to database
func CreateProjectMetric ¶
func CreateProjectMetric(projectMetric *models.ProjectMetric) errors.Error
CreateProjectMetric accepts a ProjectMetric instance and insert it to database
func CreateTask ¶
CreateTask FIXME ...
func DeleteCreatedTasks ¶
DeleteCreatedTasks deletes tasks with status `TASK_CREATED`
func DeleteDbBlueprint ¶ added in v0.14.0
DeleteDbBlueprint deletes blueprint by id
func ExecuteMigration ¶ added in v0.12.0
ExecuteMigration executes all pending migration scripts and initialize services module
func FlushProjectMetrics ¶
func FlushProjectMetrics(projectName string, baseMetrics *[]models.BaseMetric) errors.Error
FlushProjectMetrics remove all Project metrics by project name and create new metrics by baseMetrics
func GeneratePlanJsonV100 ¶ added in v0.12.0
func GeneratePlanJsonV100(settings *models.BlueprintSettings) (core.PipelinePlan, errors.Error)
GeneratePlanJsonV100 generates pipeline plan according v1.0.0 definition
func GeneratePlanJsonV200 ¶ added in v0.15.0
func GeneratePlanJsonV200( projectName string, sources *models.BlueprintSettings, metrics map[string]json.RawMessage, ) (core.PipelinePlan, errors.Error)
GeneratePlanJsonV200 generates pipeline plan according v2.0.0 definition
func GetBlueprint ¶
GetBlueprint returns the detail of a given Blueprint ID
func GetBlueprintByProjectName ¶ added in v0.15.0
GetBlueprintByProjectName returns the detail of a given ProjectName
func GetBlueprints ¶
GetBlueprints returns a paginated list of Blueprints based on `query`
func GetDbBlueprint ¶ added in v0.14.0
func GetDbBlueprint(dbBlueprintId uint64) (*models.DbBlueprint, errors.Error)
GetDbBlueprint returns the detail of a given Blueprint ID
func GetDbBlueprintByProjectName ¶ added in v0.15.0
func GetDbBlueprintByProjectName(projectName string) (*models.DbBlueprint, errors.Error)
GetDbBlueprintByProjectName returns the detail of a given projectName
func GetDbBlueprints ¶ added in v0.14.0
func GetDbBlueprints(query *BlueprintQuery) ([]*models.DbBlueprint, int64, errors.Error)
GetDbBlueprints returns a paginated list of Blueprints based on `query`
func GetDbPipeline ¶ added in v0.14.0
func GetDbPipeline(pipelineId uint64) (*models.DbPipeline, errors.Error)
GetDbPipeline by id
func GetDbPipelines ¶ added in v0.14.0
func GetDbPipelines(query *PipelineQuery) ([]*models.DbPipeline, int64, errors.Error)
GetDbPipelines by query
func GetDbProject ¶
GetDbProject returns the detail of a given project name
func GetDbProjectMetric ¶
func GetDbProjectMetric(projectName string, pluginName string) (*models.ProjectMetric, errors.Error)
GetDbProjectMetric returns the detail of a given project name
func GetDbProjectMetrics ¶
GetDbProjectMetrics returns all of Metrics of a given project name
func GetDbProjects ¶
GetDbProjects returns a paginated list of Project based on `query`
func GetPipeline ¶
GetPipeline by id
func GetPipelineLogger ¶ added in v0.15.0
GetPipelineLogger returns logger for the pipeline
func GetPipelineLogsArchivePath ¶ added in v0.13.0
GetPipelineLogsArchivePath creates an archive for the logs of this pipeline and returns its file path
func GetPipelines ¶
GetPipelines by query
func GetPluginsApiResources ¶
func GetPluginsApiResources() (map[string]map[string]map[string]core.ApiResourceHandler, errors.Error)
GetPluginsApiResources return value
{ "jira": { "connections": { "POST": *ApiResourceHandler } } }
GetPluginsApiResources returns all APIs of all plugins
func GetProject ¶ added in v0.15.0
GetProject returns a Project
func GetProjectMetric ¶
GetProjectMetric returns a ProjectMetric
func GetProjectMetrics ¶
GetProjectMetrics returns all ProjectMetric of the project
func GetProjects ¶ added in v0.15.0
GetProjects returns a paginated list of Projects based on `query`
func GetTasksWithLastStatus ¶ added in v0.15.0
GetTasksWithLastStatus returns task list of the pipeline, only the most recently tasks would be returned
func LoadBluePrintAndMetrics ¶
func LoadBluePrintAndMetrics(projectOutput *models.ApiOutputProject) errors.Error
LoadBluePrintAndMetrics load the blueprint and ProjectMetrics for projectOutputv
func MakePlanForBlueprint ¶ added in v0.15.0
MakePlanForBlueprint generates pipeline plan by version
func MigrationRequireConfirmation ¶ added in v0.12.0
func MigrationRequireConfirmation() bool
MigrationRequireConfirmation returns if there were migration scripts waiting to be executed
func ParallelizePipelinePlans ¶ added in v0.15.0
func ParallelizePipelinePlans(plans ...core.PipelinePlan) core.PipelinePlan
ParallelizePipelinePlans merges multiple pipelines into one unified plan by assuming they can be executed in parallel
func PatchBlueprint ¶ added in v0.12.0
PatchBlueprint FIXME ...
func PatchBlueprintEnableByProjectName ¶
func PatchBlueprintEnableByProjectName(projectName string, enable bool) (*models.Blueprint, errors.Error)
PatchBlueprintEnableByProjectName FIXME ...
func PatchProject ¶ added in v0.15.0
func PatchProject(name string, body map[string]interface{}) (*models.ApiOutputProject, errors.Error)
PatchProject FIXME ...
func PatchProjectMetric ¶
func PatchProjectMetric(projectName string, pluginName string, body map[string]interface{}) (*models.ProjectMetric, errors.Error)
PatchProjectMetric FIXME ...
func RunPipelineInQueue ¶ added in v0.12.0
func RunPipelineInQueue(pipelineMaxParallel int64)
RunPipelineInQueue query pipeline from db and run it in a queue
func RunTasksStandalone ¶ added in v0.15.0
RunTasksStandalone run tasks in parallel
func SaveDbBlueprint ¶ added in v0.15.0
func SaveDbBlueprint(dbBlueprint *models.DbBlueprint) errors.Error
SaveDbBlueprint accepts a Blueprint instance and upsert it to database
func SaveDbProject ¶
SaveDbProject save a project instance and update it to database
func SaveDbProjectMetric ¶
func SaveDbProjectMetric(projectMetric *models.ProjectMetric) errors.Error
SaveDbProjectMetric save a project instance and update it to database
func SequencializePipelinePlans ¶ added in v0.15.0
func SequencializePipelinePlans(plans ...core.PipelinePlan) core.PipelinePlan
SequencializePipelinePlans merges multiple pipelines into one unified plan by assuming they must be executed in sequencial order
func SpawnTasks ¶
SpawnTasks create new tasks from the failed ones
func TriggerBlueprint ¶ added in v0.12.0
TriggerBlueprint triggers blueprint immediately
func UpdateDbPipelineStatus ¶
UpdateDbPipelineStatus update the status of pipeline
func WrapPipelinePlans ¶ added in v0.15.0
func WrapPipelinePlans(beforePlanJson json.RawMessage, mainPlan core.PipelinePlan, afterPlanJson json.RawMessage) (core.PipelinePlan, errors.Error)
WrapPipelinePlans merges multiple pipelines and append before and after pipeline
Types ¶
type BlueprintQuery ¶
type BlueprintQuery struct { Enable *bool `form:"enable,omitempty"` IsManual *bool `form:"is_manual"` Page int `form:"page"` PageSize int `form:"pageSize"` Label string `form:"label"` }
BlueprintQuery is a query for GetBlueprints
type NotificationService ¶
NotificationService FIXME ...
func NewNotificationService ¶
func NewNotificationService(endpoint, secret string) *NotificationService
NewNotificationService FIXME ...
func (*NotificationService) PipelineStatusChanged ¶
func (n *NotificationService) PipelineStatusChanged(params PipelineNotification) errors.Error
PipelineStatusChanged FIXME ...
type PipelineNotification ¶
type PipelineNotification struct { PipelineID uint64 CreatedAt time.Time UpdatedAt time.Time BeganAt *time.Time FinishedAt *time.Time Status string }
PipelineNotification FIXME ...
type PipelineQuery ¶
type PipelineQuery struct { Status string `form:"status"` Pending int `form:"pending"` Page int `form:"page"` PageSize int `form:"pageSize"` BlueprintId uint64 `uri:"blueprintId" form:"blueprint_id"` Label string `form:"label"` }
PipelineQuery is a query for GetPipelines
type ProjectQuery ¶ added in v0.15.0
ProjectQuery used to query projects as the api project input
type RunningTask ¶
type RunningTask struct {
// contains filtered or unexported fields
}
RunningTask FIXME ...
func (*RunningTask) Add ¶
func (rt *RunningTask) Add(taskId uint64, cancel context.CancelFunc) errors.Error
Add FIXME ...
func (*RunningTask) FillProgressDetailToTasks ¶
func (rt *RunningTask) FillProgressDetailToTasks(tasks []models.Task)
FillProgressDetailToTasks lock less times than GetProgressDetail
func (*RunningTask) GetProgressDetail ¶
func (rt *RunningTask) GetProgressDetail(taskId uint64) *models.TaskProgressDetail
GetProgressDetail FIXME ...
func (*RunningTask) Remove ¶
func (rt *RunningTask) Remove(taskId uint64) (context.CancelFunc, errors.Error)
Remove FIXME ...
type RunningTaskData ¶
type RunningTaskData struct { Cancel context.CancelFunc ProgressDetail *models.TaskProgressDetail }
RunningTaskData FIXME ...