models

package
v0.10.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	TASK_CREATED   = "TASK_CREATED"
	TASK_RUNNING   = "TASK_RUNNING"
	TASK_COMPLETED = "TASK_COMPLETED"
	TASK_FAILED    = "TASK_FAILED"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Blueprint added in v0.10.0

type Blueprint struct {
	Name       string         `json:"name" validate:"required"`
	Tasks      datatypes.JSON `json:"tasks" validate:"required"`
	Enable     bool           `json:"enable"`
	CronConfig string         `json:"cronConfig" validate:"required"`
	common.Model
}

func (Blueprint) TableName added in v0.10.0

func (Blueprint) TableName() string

type NewPipeline added in v0.6.0

type NewPipeline struct {
	Name        string       `json:"name"`
	Tasks       [][]*NewTask `json:"tasks"`
	BlueprintId uint64
}

We use a 2D array because the request body must be an array of a set of tasks to be executed concurrently, while each set is to be executed sequentially.

type NewTask added in v0.6.0

type NewTask struct {
	// Plugin name
	Plugin string `json:"plugin" binding:"required"`
	// Options for the plugin task to be triggered
	Options     map[string]interface{} `json:"options"`
	PipelineId  uint64                 `json:"-"`
	PipelineRow int                    `json:"-"`
	PipelineCol int                    `json:"-"`
}

type Notification added in v0.3.0

type Notification struct {
	common.Model
	Type         NotificationType
	Endpoint     string
	Nonce        string
	ResponseCode int
	Response     string
	Data         string
}

Notification records notifications sent by lake

func (Notification) TableName added in v0.10.0

func (Notification) TableName() string

type NotificationType added in v0.3.0

type NotificationType string
const (
	NotificationPipelineStatusChanged NotificationType = "PipelineStatusChanged"
)

type Pipeline added in v0.6.0

type Pipeline struct {
	common.Model
	Name        string         `json:"name" gorm:"index"`
	BlueprintId uint64         `json:"blueprintId"`
	Tasks       datatypes.JSON `json:"tasks"`
	TotalTasks  int            `json:"totalTasks"`
	// Deprecated
	FinishedTasks int        `json:"finishedTasks"`
	BeganAt       *time.Time `json:"beganAt"`
	FinishedAt    *time.Time `json:"finishedAt" gorm:"index"`
	Status        string     `json:"status"`
	Message       string     `json:"message"`
	SpentSeconds  int        `json:"spentSeconds"`
	Step          int        `json:"step"`
}

func (Pipeline) TableName added in v0.10.0

func (Pipeline) TableName() string

type Task

type Task struct {
	common.Model
	Plugin         string              `json:"plugin" gorm:"index"`
	Options        datatypes.JSON      `json:"options"`
	Status         string              `json:"status"`
	Message        string              `json:"message"`
	Progress       float32             `json:"progress"`
	ProgressDetail *TaskProgressDetail `json:"progressDetail" gorm:"-"`

	FailedSubTask string     `json:"failedSubTask"`
	PipelineId    uint64     `json:"pipelineId" gorm:"index"`
	PipelineRow   int        `json:"pipelineRow"`
	PipelineCol   int        `json:"pipelineCol"`
	BeganAt       *time.Time `json:"beganAt"`
	FinishedAt    *time.Time `json:"finishedAt" gorm:"index"`
	SpentSeconds  int        `json:"spentSeconds"`
}

func (Task) TableName added in v0.10.0

func (Task) TableName() string

type TaskProgressDetail added in v0.10.0

type TaskProgressDetail struct {
	TotalSubTasks    int    `json:"totalSubTasks"`
	FinishedSubTasks int    `json:"finishedSubTasks"`
	TotalRecords     int    `json:"totalRecords"`
	FinishedRecords  int    `json:"finishedRecords"`
	SubTaskName      string `json:"subTaskName"`
	SubTaskNumber    int    `json:"subTaskNumber"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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