models

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TASK_SUCCESS = 0
	TASK_ERROR   = -1
	TASK_TIMEOUT = -2
)

Variables

This section is empty.

Functions

func Init

func Init()

func TableName

func TableName(name string) string

func TaskLogAdd

func TaskLogAdd(tlog *TaskLog) (int64, error)

func TaskLogDelByTaskId

func TaskLogDelByTaskId(taskId int) (int64, error)

func UpdateTask

func UpdateTask(id int, t *Task) error

Types

type Task

type Task struct {
	Id           int `xorm:"pk"`
	UserId       int
	GroupId      int
	Pid          int
	ServerId     int
	RunServer    string
	TaskName     string
	TaskType     int
	Description  string
	CronSpec     string
	Concurrent   int
	Command      string
	Status       int
	Notify       int
	NotifyEmail  string
	Timeout      int
	ExecuteTimes int
	PrevTime     int64
	CreateTime   int64
	UpdatedAt    int64 `xorm:"updated"`
}

func GetTaskById

func GetTaskById(id int) (*Task, error)

func GetTaskByPid

func GetTaskByPid(pid int) (*Task, error)

func (*Task) TableName

func (t *Task) TableName() string

type TaskLog

type TaskLog struct {
	Id          int
	TaskId      int
	Server      string
	Output      string
	Error       string
	Status      int
	ProcessTime int
	CreateTime  int64
}

func (*TaskLog) TableName

func (tlog *TaskLog) TableName() string

Jump to

Keyboard shortcuts

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