types

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	XTaskID    = "X-Task-ID"
	XTaskState = "X-Task-STATE"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseRes

type BaseRes struct {
	Code      int         `json:"code" yaml:"Code" toml:"code" example:"255"`
	Message   string      `json:"message" yaml:"Message" toml:"message" example:"message"`
	Timestamp int64       `json:"timestamp" yaml:"Timestamp" toml:"timestamp"`
	Data      interface{} `json:"data" yaml:"Data" toml:"data"`
}

type FileListRes

type FileListRes struct {
	Total int        `json:"total" yaml:"Total" toml:"total"`
	Files []*FileRes `json:"files" yaml:"Files" toml:"files"`
}

type FileRes

type FileRes struct {
	URL     string `json:"url" yaml:"URL" toml:"url"`
	Name    string `json:"name" yaml:"Name" toml:"name"`
	Path    string `json:"path" yaml:"Path" toml:"path"`
	Size    int64  `json:"size" yaml:"Size" toml:"size"`
	Mode    string `json:"mode" yaml:"Mode" toml:"mode"`
	ModTime int64  `json:"mod_time" yaml:"ModTime" toml:"mod_time"`
	IsDir   bool   `json:"is_dir" yaml:"IsDir" toml:"is_dir"`
}

type Healthyz

type Healthyz struct {
	Server string `json:"server" yaml:"Server" toml:"server"`
	Client string `json:"client" yaml:"Client" toml:"client"`
	State  string `json:"state" yaml:"State" toml:"state"`
}

type Notify

type Notify struct {
	Type   string `json:"type" form:"type" yaml:"Type" toml:"type" binding:"required" example:"webhook"`
	Action string `json:"action" form:"action" yaml:"Action" toml:"action" binding:"required" example:"before"` // or after
}

type Notifys

type Notifys []*Notify

type Pool

type Pool struct {
	Size    int   `json:"size" form:"command_type" yaml:"Size" toml:"size" binding:"required" example:"30"`
	Total   int64 `json:"total" yaml:"Total" toml:"total"`
	Running int64 `json:"running" yaml:"Running" toml:"running"`
	Waiting int64 `json:"waiting" yaml:"Waiting" toml:"waiting"`
}

type State

type State struct {
	Os   StateOs   `json:"os" yaml:"Os" toml:"os"`
	Cpu  StateCpu  `json:"cpu" yaml:"Cpu" toml:"cpu"`
	Ram  StateRam  `json:"ram" yaml:"Ram" toml:"ram"`
	Disk StateDisk `json:"disk" yaml:"Disk" toml:"disk"`
}

State represents activity status of Go.

type StateCpu

type StateCpu struct {
	Cpus  []float64 `json:"cpus" yaml:"Cpus" toml:"cpus"`
	Cores int       `json:"cores" yaml:"Cores" toml:"cores"`
}

type StateDisk

type StateDisk struct {
	UsedMB      int `json:"used_mb" yaml:"UsedMB" toml:"used_mb"`
	UsedGB      int `json:"used_gb" yaml:"UsedGB" toml:"used_gb"`
	TotalMB     int `json:"total_mb" yaml:"TotalMB" toml:"total_mb"`
	TotalGB     int `json:"total_gb" yaml:"TotalGB" toml:"total_gb"`
	UsedPercent int `json:"used_percent" yaml:"UsedPercent" toml:"used_percent"`
}

type StateOs

type StateOs struct {
	GOOS         string `json:"go_os" yaml:"GOOS" toml:"go_os"`
	NumCPU       int    `json:"num_cpu" yaml:"NumCPU" toml:"num_cpu"`
	Compiler     string `json:"compiler" yaml:"Compiler" toml:"compiler"`
	GoVersion    string `json:"go_version" yaml:"GoVersion" toml:"go_version"`
	NumGoroutine int    `json:"num_goroutine" yaml:"NumGoroutine" toml:"num_goroutine"`
}

type StateRam

type StateRam struct {
	UsedMB      int `json:"used_mb" yaml:"UsedMB" toml:"used_mb"`
	TotalMB     int `json:"total_mb" yaml:"TotalMB" toml:"total_mb"`
	UsedPercent int `json:"used_percent" yaml:"UsedPercent" toml:"used_percent"`
}

type Step

type Step struct {
	Name           string   `json:"name" form:"name" yaml:"Name" toml:"name" example:"script.ps1"`
	CommandType    string   `json:"command_type" form:"command_type" yaml:"CommandType" toml:"command_type" binding:"required" example:"powershell"`
	CommandContent string   `` /* 128-byte string literal not displayed */
	EnvVars        []string `json:"env_vars" form:"env_vars" yaml:"EnvVars" toml:"env_vars" example:"env1=value1,env2=value2"`
	DependsOn      []string `json:"depends_on" form:"depends_on" yaml:"DependsOn" toml:"depends_on" example:""`
	Timeout        string   `json:"timeout" form:"timeout" yaml:"Timeout" toml:"timeout" example:"3m"`
	Notify         *Notifys `json:"notify" form:"notify" yaml:"Notify" toml:"notify"`

	TimeoutDuration time.Duration `json:"-" form:"-" yaml:"-" toml:"-"`
}

type Steps

type Steps []*Step

func (Steps) Check

func (s Steps) Check(ansync bool) error

func (Steps) GetMetaData

func (s Steps) GetMetaData() (res daotypes.MetaData)

type StrTimes

type StrTimes struct {
	ST string `json:"st" yaml:"ST" toml:"st"` // 开始时间
	ET string `json:"et" yaml:"ET" toml:"et"` // 结束时间
}

type Task

type Task struct {
	ID      string  `query:"id" json:"id" form:"id" yaml:"ID" toml:"id" example:""`
	Timeout string  `query:"timeout" json:"timeout" form:"timeout" yaml:"Timeout" toml:"timeout" example:""`
	AnSync  bool    `query:"ansync" json:"ansync" form:"ansync" yaml:"AnSync" toml:"an_sync" example:"false"`
	Step    Steps   `json:"step" form:"step" yaml:"Step" toml:"step"`
	Notify  Notifys `json:"notify" form:"notify" yaml:"Notify" toml:"notify"`

	TimeoutDuration time.Duration `json:"-" form:"-" yaml:"-"`
}

func (*Task) Check

func (t *Task) Check() error

type TaskDetailRes

type TaskDetailRes struct {
	Name           string    `json:"name" yaml:"Name" toml:"name"`
	Code           int64     `json:"code" yaml:"Code" toml:"code"`
	State          int64     `json:"state" yaml:"State" toml:"state"`
	Manager        string    `json:"manager" yaml:"Manager" toml:"manager"`
	Workspace      string    `json:"workspace" yaml:"Workspace" toml:"workspace"`
	Message        string    `json:"msg" yaml:"Message" toml:"message"`
	DependsOn      []string  `json:"depends_on" yaml:"DependsOn" toml:"depends_on"`
	CommandType    string    `json:"command_type" yaml:"CommandType" toml:"command_type"`
	CommandContent string    `json:"command_content" yaml:"CommandContent" toml:"command_content"`
	Times          *StrTimes `json:"times" yaml:"Times" toml:"times"`
}

type TaskList

type TaskList struct {
	ID        string   `json:"id" yaml:"ID" toml:"id"`
	Code      int64    `json:"code" yaml:"Code" toml:"code"`
	State     int64    `json:"state" yaml:"State" toml:"state"`
	Manager   string   `json:"manager" yaml:"Manager" toml:"manager"`
	Workspace string   `json:"workspace" yaml:"Workspace" toml:"workspace"`
	Message   string   `json:"msg" yaml:"Message" toml:"message"`
	Count     int64    `json:"count" yaml:"Count" toml:"count"`
	Times     StrTimes `json:"times" yaml:"Times" toml:"times"`
}

type TaskListRes

type TaskListRes struct {
	Total int         `json:"total" yaml:"Total" toml:"total"`
	Tasks []*TaskList `json:"tasks" yaml:"Tasks" toml:"tasks"`
}

type TaskRes

type TaskRes struct {
	URL   string `json:"url" yaml:"URL" toml:"url"`
	ID    string `json:"id" form:"id" yaml:"ID" toml:"id"`
	Count int    `json:"count" yaml:"Count" toml:"count"`
}

type Version

type Version struct {
	BuildTime string      `json:"build_time" yaml:"BuildTime" toml:"build_time"`
	Version   string      `json:"version" yaml:"Version" toml:"version"`
	Git       VersionGit  `json:"git" yaml:"Git" toml:"git"`
	Go        VersionGO   `json:"go" yaml:"Go" toml:"go"`
	User      VersionUser `json:"user" yaml:"User" toml:"user"`
}

type VersionGO

type VersionGO struct {
	Arch    string `json:"arch" yaml:"Arch" toml:"arch"`
	OS      string `json:"os" yaml:"OS" toml:"os"`
	Version string `json:"version" yaml:"Version" toml:"version"`
}

type VersionGit

type VersionGit struct {
	Branch string `json:"branch" yaml:"Branch" toml:"branch"`
	Commit string `json:"commit" yaml:"Commit" toml:"commit"`
	URL    string `json:"url" yaml:"URL" toml:"url"`
}

type VersionUser

type VersionUser struct {
	Email string `json:"email" yaml:"Email" toml:"email"`
	Name  string `json:"name" yaml:"Name" toml:"name"`
}

Jump to

Keyboard shortcuts

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