model

package
v0.0.0-...-d669b54 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

README

gorm

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	gorm.Model
	Name   string `gorm:"column:name" json:"name"`               //应用名称
	Remark string `gorm:"type:text;column:remark" json:"remark"` //应用备注
	Secret string `gorm:"column:secret;size:255" json:"secret"`  //32位秘钥
}

func (App) TableName

func (App) TableName() string
type AppCmdLink struct {
	gorm.Model
	App   *App `gorm:"ForeignKey:AppId"` //执行的应用
	AppId uint `gorm:"column:app_id"`
	Cmd   *Cmd `gorm:"ForeignKey:Cmd"` //发送的命令
	CmdId uint `gorm:"column:cmd_id"`
}

func (AppCmdLink) TableName

func (AppCmdLink) TableName() string

type AppStatus

type AppStatus struct {
	gorm.Model
	AppId  uint `gorm:"column:app_id" json:"app_id"`
	App    *App
	Cpu    string `gorm:"column:cpu" json:"cpu"`
	Mem    string `gorm:"column:mem" json:"mem"`
	Disk   string `gorm:"column:disk" json:"disk"`
	Online bool   `gorm:"column:online" json:"online"`
}

func (AppStatus) TableName

func (AppStatus) TableName() string

type Cmd

type Cmd struct {
	gorm.Model
	Title    string `gorm:"column:title" json:"title"`         //命令标题
	Cmd      string `gorm:"type:text;column:cmd" json:"cmd"`   //命令内容
	Des      string `gorm:"type:text;column:des" json:"des"`   //命令描述
	IsSystem bool   `gorm:"column:is_system" json:"is_system"` //系统自有命令
	RouteKey string `gorm:"column:route_key" json:"route_key"` //消息接收队列标识
}

func (Cmd) TableName

func (Cmd) TableName() string

type SendCmd

type SendCmd struct {
	gorm.Model
	App          *App   `gorm:"ForeignKey:AppId"` //执行的应用
	AppId        uint   `gorm:"column:app_id" json:"app_id"`
	Cmd          *Cmd   `gorm:"ForeignKey:Cmd"` //发送的命令
	CmdId        uint   `gorm:"column:cmd_id" json:"cmd_id"`
	CmdStr       string `gorm:"column:cmd_str" json:"cmd_str"`
	Result       string `gorm:"type:text;column:result" json:"result"`              //执行命令结果
	ResultToJson string `gorm:"type:text;column:result_json" json:"result_to_json"` //执行命令结果json
	// contains filtered or unexported fields
}

func (*SendCmd) BeforeUpdate

func (m *SendCmd) BeforeUpdate()

func (*SendCmd) SetFormat

func (m *SendCmd) SetFormat(format format.CmdFormat)

func (*SendCmd) TableName

func (m *SendCmd) TableName() string

Jump to

Keyboard shortcuts

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