execution

package
v1.8.4-rc1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultManager

type DefaultManager struct {
}

DefaultManager ..

func (*DefaultManager) Create

func (dm *DefaultManager) Create(execution *models.Execution) (int64, error)

Create a new execution

func (*DefaultManager) CreateTask

func (dm *DefaultManager) CreateTask(task *models.Task) (int64, error)

CreateTask used to create a task

func (*DefaultManager) Get

func (dm *DefaultManager) Get(id int64) (*models.Execution, error)

Get the specified execution

func (*DefaultManager) GetTask

func (dm *DefaultManager) GetTask(id int64) (*models.Task, error)

GetTask get one specified task

func (*DefaultManager) GetTaskLog

func (dm *DefaultManager) GetTaskLog(taskID int64) ([]byte, error)

GetTaskLog get the log of one specific task

func (*DefaultManager) List

func (dm *DefaultManager) List(queries ...*models.ExecutionQuery) (int64, []*models.Execution, error)

List the summaries of executions

func (*DefaultManager) ListTasks

func (dm *DefaultManager) ListTasks(queries ...*models.TaskQuery) (int64, []*models.Task, error)

ListTasks list the tasks according to the query

func (*DefaultManager) Remove

func (dm *DefaultManager) Remove(id int64) error

Remove the execution specified by the ID

func (*DefaultManager) RemoveAll

func (dm *DefaultManager) RemoveAll(policyID int64) error

RemoveAll executions of one policy specified by the policy ID

func (*DefaultManager) RemoveAllTasks

func (dm *DefaultManager) RemoveAllTasks(executionID int64) error

RemoveAllTasks of one execution specified by the execution ID

func (*DefaultManager) RemoveTask

func (dm *DefaultManager) RemoveTask(id int64) error

RemoveTask remove one task specified by task ID

func (*DefaultManager) Update

func (dm *DefaultManager) Update(execution *models.Execution, props ...string) error

Update ...

func (*DefaultManager) UpdateTask

func (dm *DefaultManager) UpdateTask(task *models.Task, props ...string) error

UpdateTask ...

func (*DefaultManager) UpdateTaskStatus

func (dm *DefaultManager) UpdateTaskStatus(taskID int64, status string, statusCondition ...string) error

UpdateTaskStatus ...

type Manager

type Manager interface {
	// Create a new execution
	Create(*models.Execution) (int64, error)
	// List the summaries of executions
	List(...*models.ExecutionQuery) (int64, []*models.Execution, error)
	// Get the specified execution
	Get(int64) (*models.Execution, error)
	// Update the data of the specified execution, the "props" are the
	// properties of execution that need to be updated
	Update(execution *models.Execution, props ...string) error
	// Remove the execution specified by the ID
	Remove(int64) error
	// Remove all executions of one policy specified by the policy ID
	RemoveAll(int64) error
	// Create a task
	CreateTask(*models.Task) (int64, error)
	// List the tasks according to the query
	ListTasks(...*models.TaskQuery) (int64, []*models.Task, error)
	// Get one specified task
	GetTask(int64) (*models.Task, error)
	// Update the task, the "props" are the properties of task
	// that need to be updated, it cannot include "status". If
	// you want to update the status, use "UpdateTaskStatus" instead
	UpdateTask(task *models.Task, props ...string) error
	// UpdateTaskStatus only updates the task status. If "statusCondition"
	// presents, only the tasks whose status equal to "statusCondition"
	// will be updated
	UpdateTaskStatus(taskID int64, status string, statusCondition ...string) error
	// Remove one task specified by task ID
	RemoveTask(int64) error
	// Remove all tasks of one execution specified by the execution ID
	RemoveAllTasks(int64) error
	// Get the log of one specific task
	GetTaskLog(int64) ([]byte, error)
}

Manager manages the executions

func NewDefaultManager

func NewDefaultManager() Manager

NewDefaultManager ...

Jump to

Keyboard shortcuts

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