services

package
v0.11.0-testdockerpush Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2022 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ACTIVITY_PATTERN = regexp.MustCompile(`task #(\d+)`)

Functions

func CancelPipeline

func CancelPipeline(pipelineId uint64) error

func CancelTask

func CancelTask(taskId uint64) error

func CreateBlueprint

func CreateBlueprint(blueprint *models.Blueprint) error

func CreatePipeline

func CreatePipeline(newPipeline *models.NewPipeline) (*models.Pipeline, error)

func CreateTask

func CreateTask(newTask *models.NewTask) (*models.Task, error)

func DeleteBlueprint

func DeleteBlueprint(id uint64) error

func GetBlueprint

func GetBlueprint(blueprintId uint64) (*models.Blueprint, error)

func GetBlueprints

func GetBlueprints(query *BlueprintQuery) ([]*models.Blueprint, int64, error)

func GetPipeline

func GetPipeline(pipelineId uint64) (*models.Pipeline, error)

func GetPipelines

func GetPipelines(query *PipelineQuery) ([]*models.Pipeline, int64, error)

func GetPluginsApiResources

func GetPluginsApiResources() (map[string]map[string]map[string]core.ApiResourceHandler, error)

* return value

{
	"jira": {
		"connections": {
			"POST": *ApiResourceHandler
		}
	}
}

func GetRepos

func GetRepos() ([]*code.Repo, int64, error)

func GetTask

func GetTask(taskId uint64) (*models.Task, error)

func GetTasks

func GetTasks(query *TaskQuery) ([]models.Task, int64, error)

func InsertRow

func InsertRow(table string, rows []map[string]interface{}) (int64, error)

func NotifyExternal

func NotifyExternal(pipelineId uint64) error

func ReloadBlueprints

func ReloadBlueprints(c *cron.Cron) error

func RunPipeline

func RunPipeline(pipelineId uint64) error

func UpdateBlueprint

func UpdateBlueprint(blueprint *models.Blueprint) error

Types

type BlueprintQuery

type BlueprintQuery struct {
	Enable   *bool `form:"enable,omitempty"`
	Page     int   `form:"page"`
	PageSize int   `form:"pageSize"`
}

type NotificationService

type NotificationService struct {
	EndPoint string
	Secret   string
}

func NewNotificationService

func NewNotificationService(endpoint, secret string) *NotificationService

func (*NotificationService) PipelineStatusChanged

func (n *NotificationService) PipelineStatusChanged(params PipelineNotification) error

type PipelineNotification

type PipelineNotification struct {
	PipelineID uint64
	CreatedAt  time.Time
	UpdatedAt  time.Time
	BeganAt    *time.Time
	FinishedAt *time.Time
	Status     string
}

type PipelineQuery

type PipelineQuery struct {
	Status   string `form:"status"`
	Pending  int    `form:"pending"`
	Page     int    `form:"page"`
	PageSize int    `form:"pageSize"`
}

type RunningTask

type RunningTask struct {
	// contains filtered or unexported fields
}

func (*RunningTask) Add

func (rt *RunningTask) Add(taskId uint64, cancel context.CancelFunc) error

func (*RunningTask) FillProgressDetailToTasks

func (rt *RunningTask) FillProgressDetailToTasks(tasks []models.Task)

less lock times than GetProgressDetail

func (*RunningTask) GetProgressDetail

func (rt *RunningTask) GetProgressDetail(taskId uint64) *models.TaskProgressDetail

func (*RunningTask) Remove

func (rt *RunningTask) Remove(taskId uint64) (context.CancelFunc, error)

type RunningTaskData

type RunningTaskData struct {
	Cancel         context.CancelFunc
	ProgressDetail *models.TaskProgressDetail
}

type TaskQuery

type TaskQuery struct {
	Status     string `form:"status"`
	Page       int    `form:"page"`
	PageSize   int    `form:"page_size"`
	Plugin     string `form:"plugin"`
	PipelineId uint64 `form:"pipelineId" uri:"pipelineId"`
	Pending    int    `form:"pending"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL