services

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CancelPipeline added in v0.6.0

func CancelPipeline(pipelineId uint64) error

func CancelTask added in v0.3.0

func CancelTask(taskId uint64) error

func CreatePipeline added in v0.6.0

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

func CreateTask

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

func GetPipeline added in v0.6.0

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

func GetPipelines added in v0.6.0

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

func GetPluginsApiResources added in v0.3.0

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

* return value

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

func GetTask added in v0.6.0

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

func GetTasks

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

func NotifyExternal added in v0.6.0

func NotifyExternal(pipelineId uint64) error

func RunPipeline added in v0.6.0

func RunPipeline(pipelineId uint64) error

func RunTask added in v0.3.0

func RunTask(taskId uint64) error

RunTask guarantees database is update even if it panicked, and the error will be returned to caller

Types

type NotificationService added in v0.3.0

type NotificationService struct {
	EndPoint string
	Secret   string
}

func NewNotificationService added in v0.3.0

func NewNotificationService(endpoint, secret string) *NotificationService

func (*NotificationService) PipelineStatusChanged added in v0.6.0

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

type PipelineNotification added in v0.6.0

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

type PipelineQuery added in v0.6.0

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

type RunningTask added in v0.6.0

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

func (*RunningTask) Add added in v0.6.0

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

func (*RunningTask) Remove added in v0.6.0

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

type TaskQuery added in v0.4.0

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