model

package
v0.0.0-...-a97389e Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Models = []interface{}{
		&Interpreter{},
		&Site{},
		&Workspace{},
		&Proxy{},
		&Server{},
		&Statistic{},
		&Job{},
	}
)

Functions

This section is empty.

Types

type BaseModel

type BaseModel struct {
	ID        uint       `gorm:"primary_key" sql:"type:INT(10) UNSIGNED NOT NULL" json:"id"`
	CreatedAt *time.Time `json:"createdAt"`
	UpdatedAt *time.Time `json:"updatedAt"`

	Deleted  bool `json:"deleted" gorm:"default:false"`
	Disabled bool `json:"disabled" gorm:"default:false"`
}

type Interpreter

type Interpreter struct {
	BaseModel

	Lang string `json:"lang"`
	Path string `json:"path"`
}

func (Interpreter) TableName

func (Interpreter) TableName() string

type JSON

type JSON json.RawMessage

func (*JSON) Scan

func (j *JSON) Scan(value interface{}) error

func (JSON) Value

func (j JSON) Value() (driver.Value, error)

实现 driver.Valuer 接口,Value 返回 json value

type Job

type Job struct {
	BaseModel

	Name string `json:"name"`
	Desc string `json:"desc,omitempty"`

	Workspace string `json:"workspace"`
	Path      string `json:"path"`
	Ids       string `json:"ids"`
	Cmd       string `json:"cmd"`

	Status commConsts.JobStatus `json:"status"`
	Retry  int                  `json:"retry"`

	StartDate   *time.Time `json:"startDate"`
	EndDate     *time.Time `json:"endDate"`
	TimeoutDate *time.Time `json:"timeoutDate,omitempty"`
	CancelDate  *time.Time `json:"cancelDate,omitempty"`

	Task int `json:"task"`
}

func (Job) TableName

func (Job) TableName() string

type Proxy

type Proxy struct {
	BaseModel

	Name string `json:"name"`
	Path string `json:"path"`
}

func (Proxy) TableName

func (Proxy) TableName() string

type Server

type Server struct {
	BaseModel

	Name      string `json:"name"`
	Path      string `json:"path"`
	IsDefault bool   `json:"is_default"`
}

func (Server) TableName

func (Server) TableName() string

type Site

type Site struct {
	BaseModel

	Name     string `json:"name"`
	Url      string `json:"url"`
	Username string `json:"username"`
	Password string `json:"password"`

	IsDefault bool `json:"isDefault"`
}

func (Site) TableName

func (Site) TableName() string

type Statistic

type Statistic struct {
	BaseModel

	Path     string `json:"path" gorm:"unique"`
	Total    int    `json:"total"`
	Succ     int    `json:"succ"`
	Fail     int    `json:"fail"`
	FailLogs string `json:"fail_logs"`
}

func (Statistic) TableName

func (Statistic) TableName() string

type Workspace

type Workspace struct {
	BaseModel

	Path string              `json:"path"`
	Name string              `json:"name"`
	Desc string              `json:"desc" gorm:"column:descr"`
	Type commConsts.TestTool `json:"type" gorm:"default:ztf"`
	Lang string              `json:"lang"`
	Cmd  string              `json:"cmd"`

	ProxyId   uint `json:"proxy_id"`
	SiteId    uint `json:"siteId"`
	ProductId uint `json:"productId"`

	IsDefault bool `json:"isDefault"`
}

func (Workspace) TableName

func (Workspace) TableName() string

Jump to

Keyboard shortcuts

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