model

package
v0.0.0-...-53a20a4 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseModel

type BaseModel struct {
	ID        uint      `gorm:"primarykey;type:bigint auto_increment"`
	CreatedAt time.Time `gorm:"autoCreateTime"`
	UpdatedAt time.Time `gorm:"autoUpdateTime"`
}

type CmdType

type CmdType []string

func (*CmdType) Scan

func (c *CmdType) Scan(src any) error

func (CmdType) Value

func (c CmdType) Value() (driver.Value, error)

type Job

type Job struct {
	BaseModel
	ID          uint      `gorm:"primarykey;type:bigint auto_increment"`
	Status      JobStatus `gorm:"type:int"`
	Name        string
	Description string
	Dag         JobDag       `gorm:"type:json"`
	RawDag      JobRawDagmap `gorm:"type:json"`
	Parameter   JobParameter `gorm:"type:json"`
	Tasks       []Task
	NotifyUrl   string
}

type JobDag

func (*JobDag) Scan

func (c *JobDag) Scan(src any) error

func (JobDag) Value

func (c JobDag) Value() (driver.Value, error)

type JobParameter

type JobParameter parser.Role2Parameter

func (*JobParameter) Scan

func (c *JobParameter) Scan(src any) error

func (JobParameter) Value

func (c JobParameter) Value() (driver.Value, error)

type JobRawDagmap

type JobRawDagmap parser.Role2DagTaskMap

func (*JobRawDagmap) Scan

func (c *JobRawDagmap) Scan(src any) error

func (JobRawDagmap) Value

func (c JobRawDagmap) Value() (driver.Value, error)

type JobStatus

type JobStatus int
const (
	JobInit      JobStatus = 1
	JobRunning   JobStatus = 2
	JobSuccess   JobStatus = 3
	JobFailed    JobStatus = 4
	JobCancelled JobStatus = 5
)

func (*JobStatus) Scan

func (c *JobStatus) Scan(value interface{}) error

func (JobStatus) Value

func (c JobStatus) Value() (driver.Value, error)

type Task

type Task struct {
	BaseModel
	ID              uint `gorm:"primarykey;type:bigint auto_increment"`
	JobID           uint `gorm:"type:bigint"`
	Job             Job
	Group           string
	Status          TaskStatus `gorm:"type:int"`
	Name            string
	Description     string
	Pid             int
	OrderInJob      int
	Dag             TaskDag       `gorm:"type:json"`
	Parameters      TaskParameter `gorm:"type:json"`
	CommonParameter string
	UpTasks         []Task `gorm:"many2many:TaskLink;joinForeignKey:DownId;joinReferences:UpId"`
	DownTasks       []Task `gorm:"many2many:TaskLink;joinForeignKey:UpId;joinReferences:DownId"`
	// MemoryLimited   uint64
	// Cmd             CmdType       `gorm:"type:json"`
	// ValidateCmd     string
	CmdRet      string
	NotifyUrl   string
	GotCmdToRun bool
	RunOnNode   string
	Summary     json.RawMessage `gorm:"type:json"`
}

type TaskDag

type TaskDag dagparser.TaskParsered

func (*TaskDag) Scan

func (c *TaskDag) Scan(src any) error

func (TaskDag) Value

func (c TaskDag) Value() (driver.Value, error)
type TaskLink struct {
	UpId   uint `gorm:"type:bigint"`
	DownId uint `gorm:"type:bigint"`
}

type TaskParameter

type TaskParameter parameterparser.TaskParameter

func (*TaskParameter) Scan

func (c *TaskParameter) Scan(src any) error

func (TaskParameter) Value

func (c TaskParameter) Value() (driver.Value, error)

type TaskResult

type TaskResult struct {
	BaseModel
	TaskId   uint `gorm:"type:bigint"`
	Task     Task
	Tag      string
	TaskName string
	Ret      string
}

type TaskStatus

type TaskStatus int
const (
	TaskInit      TaskStatus = 1
	TaskReady     TaskStatus = 2
	TaskRunning   TaskStatus = 3
	TaskSuccess   TaskStatus = 4
	TaskFailed    TaskStatus = 5
	TaskTimeout   TaskStatus = 6
	TaskCancelled TaskStatus = 7
)

func (*TaskStatus) Scan

func (c *TaskStatus) Scan(value interface{}) error

func (TaskStatus) Value

func (c TaskStatus) Value() (driver.Value, error)

type TaskUpTasks

type TaskUpTasks []string

func (*TaskUpTasks) Scan

func (c *TaskUpTasks) Scan(src any) error

func (TaskUpTasks) Value

func (c TaskUpTasks) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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