models

package
v0.0.0-...-31148e1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// QUEUED - task insert in master executor and sending to
	QUEUED TaskStatusIndx = 1
	// RUNNING - task start in slave executor
	RUNNING = 2
	// CANCELED - task was stopped by client (like default plugin or portal)
	CANCELED = 3
	// FAILED - task was failed
	FAILED = 4 // task was failed
	// SUCCESS - task was successfully
	SUCCESS = 5 // task was successfull
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerCreatePayload

type ContainerCreatePayload struct {
	BaseImageName string   `json:"image"`
	WorkDir       string   `json:"workdir"`
	ShellCommands []string `json:"shell"`
	ContainerName string   `json:"container_name"`
}

ContainerCreatePayload - payload for docker_runner module

type EhancedTaskForView

type EhancedTaskForView struct {
	ID            string
	SlaveIndex    int
	StatusTask    string
	Stage         string
	StatusJobs    []EnhancedJobStatus
	TimeCreated   int64
	TimeFinishing int64
}

func ConvertArrayTasks

func ConvertArrayTasks(tasks []Task) []EhancedTaskForView

type EnhancedJobStatus

type EnhancedJobStatus struct {
	StatusIndex   string
	Job           string
	TimeFinishing int64
}

type Job

type Job struct {
	JobName             string            `yaml:"-"`
	Stage               string            `yaml:"stage" json:"stage"`
	TaskID              string            `yaml:"-"`
	Image               []string          `yaml:"image" json:"image"`
	Timeout             int64             `yaml:"timeout" json:"timeout"`
	RepositoryCandidate string            `yaml:"repo" json:"repo"`
	ShellCommands       []string          `yaml:"run" json:"run"`
	Reports             map[string]string `yaml:"reports" json:"reports"`
}

Job - primitive which parsed from entered yaml from portal

type JobStatus

type JobStatus struct {
	StatusIndex   TaskStatusIndx
	Job           string
	TimeFinishing int64
}

JobStatus - статус выполненной\не выполненной джобы

func (JobStatus) ConvertToPayload

func (jobstatus JobStatus) ConvertToPayload() EnhancedJobStatus

type LogsPerTask

type LogsPerTask struct {
	STDOUT []string
	STDERR []string
}

LogsPerTask - логи по выполнению какой-либо джобы

type ReportPerTask

type ReportPerTask struct {
	Result map[string][]string
}

ReportPerTask - модель отчёта для мастера на уровне джобы

type Task

type Task struct {
	ID            string
	SlaveIndex    int
	StatusTask    TaskStatusIndx
	Stage         string
	StatusJobs    []JobStatus
	TimeCreated   int64
	TimeFinishing int64
}

Task - description for task

func (Task) ConvertToPayload

func (task Task) ConvertToPayload() EhancedTaskForView

type TaskConfig

type TaskConfig struct {
	Jobs   map[string]Job `yaml:"jobs" json:"jobs"`
	Stages []string       `yaml:"stages" json:"stages"`
	TaskID string         `yaml:"taskID" json:"taskID"`
}

TaskConfig - configuration task by description jobs, stages, identifier of task

func (*TaskConfig) ToByteArray

func (task *TaskConfig) ToByteArray() ([]byte, error)

ToByteArray - конвертация текущей модели в массив байтов для передачи по сети

func (*TaskConfig) Validate

func (task *TaskConfig) Validate() bool

Validate - валидация входящего задания в исполняющий модуль

type TaskStatusIndx

type TaskStatusIndx int

TaskStatusIndx - индекс текущого статуса

func (TaskStatusIndx) GetString

func (taskStatus TaskStatusIndx) GetString() string

GetString - строковое представление статуса

Jump to

Keyboard shortcuts

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