mysql

package
v0.0.0-...-f35954e Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Conn string
)

Functions

func InitDb

func InitDb() (*gorm.DB, error)

Types

type Base

type Base struct {
	ID          uint64     `gorm:"primary_key" json:"id"`
	CreatedAt   time.Time  `json:"-"`
	UpdatedAt   time.Time  `json:"update_at"`
	DeletedAt   *time.Time `sql:"index" json:"-"`
	DataVersion int        `gorm:"not null;default:0;comment:'数据版本'" json:"-"`
}

type Env

type Env struct {
	Base
	Name     string `gorm:"unique;size:16;not null;default:'';comment:'HOST'" json:"name"`
	ServType int    `gorm:"not null;default:0;comment:'服务类型'" json:"serv_type"`
	Hosts    []Host `gorm:"ForeignKey:EnvId;AssociationForeignKey:ID" json:"hosts"`
}

type Host

type Host struct {
	Base
	EnvID    uint64 `gorm:"not null;default:0;comment:'EnvID'" json:"env_id"`
	Name     string `gorm:"unique;size:16;not null;default:'';comment:'HOST'" json:"name"`
	ServType int    `gorm:"not null;default:0;comment:'服务类型'" json:"serv_type"`
}

type RouteItem

type RouteItem struct {
	Base
	ParentID   uint64      `gorm:"not null;default:0;;comment:'组ID'" json:"parent_id"`
	Name       string      `gorm:"size:32;not null;default:'';comment:'名称'" json:"name"`
	Idx        string      `gorm:"size:32;not null;default:'';comment:'index'" json:"index"`
	Class      string      `gorm:"size:32;not null;default:'';comment:'图标'" json:"class"`
	RouteItems []RouteItem `gorm:"ForeignKey:ID;AssociationForeignKey:ParentID" json:"items"`
}

type Serv

type Serv struct {
	Base
	ServName  string    `gorm:"unique;size:32;not null;default:'';comment:'服务名称'" json:"serv_name"`
	ServType  int       `gorm:"not null;default:0;comment:'服务类型'" json:"serv_type"`
	LocalPath string    `gorm:"size:256;not null;default:'';comment:'本地路径'" json:"local_path"`
	ServMd5   string    `gorm:"-" json:"serv_md5"`
	ServEnvs  []ServEnv `gorm:"ForeignKey:ServID;AssociationForeignKey:ID" json:"serv_envs"`
}

type ServConf

type ServConf struct {
	Serv       Serv               `json:"serv"`
	ServEnvMap map[string]ServEnv `json:"servenv_list"`
}

type ServEnv

type ServEnv struct {
	Base
	ServID     uint64 `gorm:"not null;default:0;;comment:'服务ID'" json:"serv_id"`
	ServName   string `gorm:"size:32;not null;default:'';comment:'服务名称'" json:"serv_name"`
	EnvID      uint64 `gorm:"not null;default:0;;comment:'环境ID'" json:"env_id"`
	Env        string `gorm:"size:32;not null;default:'';comment:'发布环境'" json:"env"`
	RemotePath string `gorm:"size:256;not null;default:'';comment:'安装路径'" json:"remote_path"`
	ServMd5    string `gorm:"-" json:"serv_md5"`
}

type ServFlt

type ServFlt struct {
	Env      string `json:"env"`
	ServName string `json:"serv_name"`
}

type ServState

type ServState struct {
	HostName string `json:"host_name" sql:"-"`
	ServTime string `json:"serv_time" sql:"-"`
}

type UserGroup

type UserGroup struct {
	Type  string `json:"type"`
	Name  string `json:"name"`
	Group string `json:"group"`
}

Jump to

Keyboard shortcuts

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