model

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CmdStart   = "start"
	CmdStop    = "stop"
	CmdReload  = "reload"
	CmdList    = "list"
	CmdMonitor = "monitor"
)
View Source
const (
	StatusInit    = "init"    // init process
	StatusRunning = "running" // success running
	StatusStopped = "stopped" // success finished or run stop success
	StatusReload  = "reload"  //
	StatusFailed  = "failed"  // run error
)
View Source
const EOF = "\r\n\r\n"

数据传输结束标记

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	gorm.Model
	Version string
}

func (App) TableName

func (App) TableName() string

type ExecFlags

type ExecFlags struct {
	User          string `json:"user"`
	Log           string `json:"log"`
	LogDir        string `json:"log_dir"`
	NoAutoRestart bool   `json:"no_auto_restart"`
	Args          string `json:"args"`
	Name          string `json:"name"`
}

func (*ExecFlags) Json

func (e *ExecFlags) Json() string

func (*ExecFlags) Parse

func (e *ExecFlags) Parse(jsonStr string) (*ExecFlags, error)

type Package

type Package struct {
	Cmd  string `json:"cmd"`
	Data string `json:"data"`
}

func (*Package) MustToJson

func (p *Package) MustToJson() []byte

type Process

type Process struct {
	ID          uint        `gorm:"primary_key" json:"id"`
	CreatedAt   time.Time   `json:"created_at"`
	UpdatedAt   time.Time   `json:"updated_at"`
	DeletedAt   *time.Time  `sql:"index" json:"deleted_at"`
	Pid         int         `gorm:"column:pid" json:"pid"`
	Log         string      `gorm:"column:log" json:"log"`
	Name        string      `json:"name"`
	ProcessFile string      `json:"process_file"`
	Args        string      `json:"args"`
	Status      string      `json:"status"`
	Pointer     *os.Process `gorm:"-" json:"-"`
	AutoRestart bool        `json:"auto_restart"`
	Uid         string
	Username    string
	Gid         string
}

func (Process) MustJson

func (p Process) MustJson() string

func (Process) NoAutoRestartStr

func (p Process) NoAutoRestartStr() string

func (Process) RenderTable

func (p Process) RenderTable() []string

func (Process) TableName

func (Process) TableName() string

type Rsp

type Rsp struct {
	Code int
	Msg  string
	Data string
}

func (Rsp) ToJson

func (r Rsp) ToJson(suffix string) []byte

Jump to

Keyboard shortcuts

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