db

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	K8sPub = int(iota)
	K8sRestart
	K8sStop
	K8sStatus
)

K8sPub ...

View Source
const (
	Redis = iota + 1
	Memcache
	Mongo
	MySQL
	RPC
	Nginx
	PHP
	LUA
	GO
	JAVA
	PYTHON
	FED
	FLASH
	CPP
)

语言类型常量

View Source
const (
	OTHERLv = iota
	ProxyLv
	AppLv
	GateWayLv
	ServiceLv
	DataLv
)

架构层级

View Source
const (
	EventSystem   = "system"   // 系统触发,正常用户点击发布
	EventRollback = "rollback" // 回滚事件
	EventWebHook  = "webhook"  // 由gitlab事件触发的统一为webhook事件,如有需要再细分
	EventPush     = "push"
	EventPull     = "pull_request"
	EventTag      = "tag"
)

EventSystem ...

View Source
const (
	StatusInit     = 0
	StatusSuccess  = 1
	StatusRunning  = 2
	StatusPending  = 3
	StatusSkipped  = 4
	StatusFailure  = 5
	StatusCanceled = 6
)

StatusInit ...

View Source
const (
	GoPkgToml = "/Gopkg.lock"
)

GoPkgToml ...

Variables

View Source
var (
	CasbinPolicyTypeMenu CasbinPolicyType = "menu"
	CasbinPolicyTypeApp  CasbinPolicyType = "app"
	CasbinPolicyTypeAPI  CasbinPolicyType = "api"

	AppPermAppRead     = "app:read"
	AppPermConfigRead  = "config:read"
	AppPermConfigWrite = "config:write"
	AppPermMonitorRead = "monitor:read"
	AppPermPProfRead   = "pprof:read"
	AppPermPProfRun    = "pprof:run"
)
View Source
var (
	CasbinGroupTypeUser = "user"
	CasbinGroupTypeApp  = "app"
	CasbinGroupTypeMenu = "url"
)
View Source
var LangTypes = []string{
	Redis:    "Redis",
	Memcache: "Memcache",
	Mongo:    "Mongo",
	MySQL:    "MySQL",
	RPC:      "RPC",
	Nginx:    "Nginx",
	PHP:      "PHP",
	LUA:      "Lua",
	GO:       "Go",
	JAVA:     "Java",
	PYTHON:   "Python",
	FED:      "Fed",
	FLASH:    "Flash",
	CPP:      "C++",
}

LangTypes 语言类型数组映射

View Source
var LevelTypes = []string{
	OTHERLv:   "其他",
	ProxyLv:   "代理",
	AppLv:     "应用",
	GateWayLv: "网关",
	ServiceLv: "服务",
	DataLv:    "数据",
}

LevelTypes 五层架构名称map

Functions

This section is empty.

Types

type AccessToken added in v0.2.0

type AccessToken struct {
	gorm.Model
	Name   string `json:"name" gorm:"type:varchar(32);unique;"`
	AppID  string `json:"app_id" gorm:"type:varchar(32);unique;"`
	Secret string `json:"secret" gorm:"type:varchar(64);"`
}

func (AccessToken) TableName added in v0.2.0

func (AccessToken) TableName() string

type AppChangeMap

type AppChangeMap struct {
	ID        int    `json:"id" gorm:"not null;column:id"` // id类型?
	AppName   string `json:"appName" gorm:"not null;column:app_name;index"`
	Md5       string `json:"md5" gorm:"not null;column:md5;index"`
	UpdatedAt int64  `json:"updatedAt" gorm:"not null;column:updated_at"`
}

AppChangeMap ..

func (*AppChangeMap) TableName

func (t *AppChangeMap) TableName() string

TableName ..

type AppCmcStat

type AppCmcStat struct {
	Env string `json:"env"`
	Cnt int    `json:"cnt"`
}

AppCmcStat ..

type AppContainer

type AppContainer struct {
	ID     uint `gorm:"primary_key"`
	Aid    int  `json:"aid"`
	IdcID  int  `json:"idc_id"`
	K8sAid int  `json:"k8s_aid"`
}

AppContainer ...

func (AppContainer) TableName

func (AppContainer) TableName() string

TableName ...

type AppEvent

type AppEvent struct {
	ID            int    `gorm:"primary_key,not null;AUTO_INCREMENT" json:"id"` // 数据id
	AppName       string `gorm:"not null;index:idx_app_name" json:"app_name"`   // 应用名称
	Aid           int    `gorm:"not null;index:idx_aid" json:"aid"`             // 应用id
	ZoneCode      string `gorm:"not null;index:idx_zone_code" json:"zone_code"` // 环境
	Env           string `gorm:"not null;index:idx_env" json:"env"`             // 环境
	HostName      string `gorm:"not null;" json:"host_name"`
	UserName      string `gorm:"not null;" json:"user_name"`                     // 用户名
	UID           int    `gorm:"not null;" json:"uid"`                           // 用户id
	Operation     string `gorm:"not null; index:idx_operation" json:"operation"` // 操作
	CreateTime    int64  `gorm:"" json:"create_time"`                            // 事件发生时间
	Source        string `gorm:"not null;index:idx_source" json:"source"`        // 事件来源
	Metadata      string `gorm:"not null;type:text" json:"metadata"`             // 事件内容
	OperationName string `gorm:"-" json:"operation_name"`
	SourceName    string `gorm:"-" json:"source_name"`
}

AppEvent ..

func (*AppEvent) HandleOperationName

func (a *AppEvent) HandleOperationName()

HandleOperationName ..

func (*AppEvent) HandleSourceName

func (a *AppEvent) HandleSourceName()

HandleSourceName ..

func (*AppEvent) TableName

func (a *AppEvent) TableName() string

TableName ..

type AppInfo

type AppInfo struct {
	Aid        int          `gorm:"not null;primary_key;AUTO_INCREMENT" json:"aid"`
	Gid        int          `gorm:"not null;comment:'gitlab id'" json:"gid"`
	Name       string       `gorm:"not null;index;comment:'项目中文名'" json:"name"`
	AppName    string       `gorm:"not null;index;comment:'项目英文唯一标识名'" json:"app_name"`
	CreateTime int64        `gorm:"not null;comment:'创建时间'" json:"create_time"`
	UpdateTime int64        `gorm:"not null;comment:'更新时间'" json:"update_time"`
	Level      int          `gorm:"not null;comment:'层级'" json:"level"`
	Lang       string       `gorm:"not null;comment:'语言'" json:"lang"`
	BizDomain  string       `gorm:"not null;comment:'业务类型'" json:"biz_domain"`
	CreatedBy  int          `gorm:"not null;comment:'创建者'" json:"created_by"`
	UpdatedBy  int          `gorm:"not null;comment:'更新者'" json:"updated_by"`
	HTTPPort   string       `gorm:"not null;comment:'HTTP端口号'" json:"http_port"`
	RPCPort    string       `gorm:"not null;comment:'RPC端口号'" json:"rpc_port" `
	GovernPort string       `gorm:"not null;comment:'治理端口号'" json:"govern_port" `
	HookID     int          `gorm:"not null;comment:'钩子'" json:"hook_id"`
	Users      UserNameJSON `gorm:"not null;type:json;comment:'业务负责人'" json:"users"`
	WebURL     string       `gorm:"not null;" json:"web_url"`
	ProtoDir   string       `gorm:"not null;" json:"proto_dir"`
	GitURL     string       `gorm:"not null;" json:"git_url"`

	AppNodes []AppNode `gorm:"foreignKey:Aid;association_foreignkeyAid" json:"-"`
}

AppInfo ...

func (*AppInfo) MD5String

func (a *AppInfo) MD5String() string

MD5String ...

func (AppInfo) TableName

func (AppInfo) TableName() string

TableName ...

type AppLog

type AppLog struct {
	ID         int          `gorm:"not null;primary_key;comment:'应用id'" json:"id"`
	Aid        int          `gorm:"not null;comment:'应用id'" json:"aid"`
	Gid        int          `gorm:"not null;comment:'gitlab id'" json:"gid"`
	Name       string       `gorm:"not null;index;comment:'项目中文名'" json:"name"`
	AppName    string       `gorm:"not null;index;comment:'项目英文唯一标识名'" json:"appName"`
	CreateTime int64        `gorm:"not null;comment:'创建时间'" json:"createTime"`
	UpdateTime int64        `gorm:"not null;comment:'更新时间'" json:"updateTime"`
	Level      int          `gorm:"not null;comment:'层级'" json:"level"`
	Lang       string       `gorm:"not null;comment:'语言'" json:"lang"`
	BizDomain  string       `gorm:"not null;" json:"bizDomain"`
	CreatedBy  int          `gorm:"not null;comment:'创建者'" json:"createdBy"`
	UpdatedBy  int          `gorm:"not null;comment:'更新者'" json:"updatedBy"`
	HTTPPort   string       `json:"httpPort" gorm:"not null;column:http_port"`
	RPCPort    string       `json:"rpcPort" gorm:"not null;column:rpc_port"`
	HealthPort string       `json:"healthPort" gorm:"not null;column:health_port"`
	HookID     int          `gorm:"not null;comment:'钩子'" json:"hookId"`
	Users      UserNameJSON `gorm:"not null;type:json" json:"users"`
	WebURL     string       `gorm:"not null;" json:"webUrl"`
	Action     string       `gorm:"null;type:varchar(32);comment:'动作';column:action" json:"action"`
	CreatedAt  time.Time    `gorm:"null;column:created_at;comment:'记录创建时间'" json:"createdAt"`
}

AppLog ...

func (AppLog) TableName

func (AppLog) TableName() string

TableName ...

type AppLogAction

type AppLogAction string

AppLogAction ..

const (
	// AppLogActionDelete ..
	AppLogActionDelete AppLogAction = "delete"
	// AppLogActionManuallyDelete ..
	AppLogActionManuallyDelete AppLogAction = "manual_delete"
)

type AppNode

type AppNode struct {
	ID         int    `json:"id" gorm:"not null;column:id"` // id类型?
	AppName    string `json:"app_name" gorm:"not null;column:app_name"`
	Aid        int    `json:"aid" gorm:"not null;column:aid"` // id类型?
	HostName   string `json:"host_name" gorm:"not null;column:host_name"`
	IP         string `json:"ip" gorm:"not null;column:ip"`
	DeviceID   int    `json:"device_id" gorm:"not null;column:device_id"`
	Env        string `json:"env" gorm:"not null"`
	RegionCode string `json:"region_code" gorm:"not null"`
	RegionName string `json:"region_name" gorm:"not null"`
	ZoneCode   string `json:"zone_code" gorm:"not null"`
	ZoneName   string `json:"zone_name" gorm:"not null"`
	CreateTime int64  `gorm:"not null;" json:"create_time"`
	UpdateTime int64  `gorm:"not null;" json:"update_time"`
}

AppNode ..

func (*AppNode) TableName

func (t *AppNode) TableName() string

TableName ..

type AppNodeAgentView

type AppNodeAgentView struct {
	HostName string `json:"host_name"`
	IPPort   string `json:"ip"`
}

AppNodeAgentView ..

type AppNodeInfoLog

type AppNodeInfoLog struct {
	Id         int    `json:"id" gorm:"column:id"` // id类型?
	AppName    string `json:"app_name" gorm:"column:app_name"`
	Aid        int    `json:"aid" gorm:"column:aid"`             // id类型?
	ZoneCode   string `json:"zone_code" gorm:"column:zone_code"` // id类型?
	NodeKey    string `json:"node_key" gorm:"column:node_key"`
	BuildTime  string `json:"build_time" gorm:"column:build_time"`
	HostName   string `json:"host_name" gorm:"column:host_name"`
	Pid        int    `json:"pid" gorm:"column:pid"`                 // id类型?
	UpdateTime int64  `json:"update_time" gorm:"column:update_time"` // 时间类型?
	VcsInfo    string `json:"vcs_info" gorm:"column:vcs_info"`
	CreatedAt  int64  `json:"created_at" gorm:"column:created_at"`
	UserName   string `json:"user_name" gorm:"column:user_name"`
	Action     string `json:"action" gorm:"column:action"`
}

func (*AppNodeInfoLog) TableName

func (t *AppNodeInfoLog) TableName() string

type AppNodeMap

type AppNodeMap struct {
	ID      int    `json:"id"`
	Aid     int    `json:"aid"`
	AppName string `json:"app_name"`
	MD5     string `json:"md5"` // 由md5(app_name+deviceIDs)
}

AppNodeMap ..

func (*AppNodeMap) TableName

func (a *AppNodeMap) TableName() string

TableName ..

type AppPackage

type AppPackage struct {
	ID         int    `json:"id" gorm:"not null;column:id"`   // id类型?
	Aid        int    `json:"aid" gorm:"not null;column:aid"` // id类型?
	Name       string `json:"name" gorm:"not null;column:name"`
	Branch     string `json:"branch" gorm:"not null;column:branch"`
	Version    string `json:"version" gorm:"not null;column:version"`
	Revision   string `json:"revision" gorm:"not null;column:revision"`
	Packages   string `json:"packages" gorm:"not null;type:text"`
	UpdateTime int64  `json:"updateTime" gorm:"not null;column:update_time"` // 时间类型?
}

AppPackage ...

func (*AppPackage) TableName

func (t *AppPackage) TableName() string

TableName ...

type AppRegInfoLog

type AppRegInfoLog struct {
	Id        int    `json:"id" gorm:"column:id"`   // id类型?
	Aid       int    `json:"aid" gorm:"column:aid"` // id类型?
	AppName   string `json:"app_name" gorm:"column:app_name"`
	IdcId     int    `json:"idc_id" gorm:"column:idc_id"` // id类型?
	RegKey    string `json:"reg_key" gorm:"column:reg_key"`
	KeyStatus string `json:"key_status" gorm:"column:key_status"`
	Addr      string `json:"addr" gorm:"column:addr"`
	Ip        string `json:"ip" gorm:"column:ip"`
	Port      string `json:"port" gorm:"column:port"`
	CreatedAt int    `json:"created_at" gorm:"column:created_at"`
	UserName  string `json:"user_name" gorm:"column:user_name"`
	Action    string `json:"action" gorm:"column:action"`
}

节点操作日志

func (*AppRegInfoLog) TableName

func (t *AppRegInfoLog) TableName() string

type AppStatics

type AppStatics struct {
	Aid             int    `gorm:"not null;" json:"aid"`
	AppName         string `gorm:"not null;" json:"appName"`
	GitPush         int    `gorm:"not null;" json:"gitPush"`
	GitTagPush      int    `gorm:"not null;" json:"gitTagPush"`
	GitIssue        int    `gorm:"not null;" json:"gitIssue"`
	GitMergeRequest int    `gorm:"not null;" json:"gitMergeRequest"`
	GitWikiPage     int    `gorm:"not null;" json:"gitWikiPage"`
	GitPipeline     int    `gorm:"not null;" json:"gitPipeline"`
	GitJob          int    `gorm:"not null;" json:"gitJob"`

	CmcCreate int `gorm:"not null;" json:"cmcCreate"`
	CmcUpdate int `gorm:"not null;" json:"cmcUpdate"`
	CmcDelete int `gorm:"not null;" json:"cmcDelete"`

	AppCreate int `gorm:"not null;" json:"appCreate"`
	AppUpdate int `gorm:"not null;" json:"appUpdate"`
	AppDelete int `gorm:"not null;" json:"appDelete"`

	NodeCreate int `gorm:"not null;" json:"nodeCreate"`
	NodeUpdate int `gorm:"not null;" json:"nodeUpdate"`
	NodeDelete int `gorm:"not null;" json:"nodeDelete"`

	PprofCreate int `gorm:"not null;" json:"pprofCreate"`

	DevopsUpdate     int `gorm:"not null;" json:"devopsUpdate"`
	DevopsRegister   int `gorm:"not null;" json:"devopsRegister"`
	DevopsUnregister int `gorm:"not null;" json:"devopsUnregister"`
	DevopsStart      int `gorm:"not null;" json:"devopsStart"`
	DevopsRestart    int `gorm:"not null;" json:"devopsRestart"`
	DevopsStop       int `gorm:"not null;" json:"devopsStop"`
	DevopsDeploy     int `gorm:"not null;" json:"devopsDeploy"`
	DevopsRollback   int `gorm:"not null;" json:"devopsRollback"`

	UpdatedAt time.Time `gorm:"" json:"updatedAt"`
	CreatedAt time.Time `gorm:"" json:"createdAt"`
}

AppStatics ..

func (AppStatics) TableName

func (AppStatics) TableName() string

TableName ..

type AppTopology

type AppTopology struct {
	ID         int    `gorm:"not null;" json:"id"`
	Aid        int    `gorm:"not null;" json:"aid"`
	AppName    string `gorm:"not null;" json:"app_name" query:"app_name"`
	RegionCode string `gorm:"not null;" json:"region_code" query:"region_code"`
	ZoneCode   string `gorm:"not null;" json:"zone_code" query:"zone_code"`
	Env        string `gorm:"not null;" json:"env" query:"env"`
	FileName   string `gorm:"not null;" json:"file_name"`
	Addr       string `gorm:"not null;" json:"addr" query:"addr"`
	IP         string `gorm:"not null;" json:"ip"`
	Port       string `gorm:"not null;" json:"port"`
	Name       string `gorm:"not null;" json:"name" query:"name"`
	Type       string `gorm:"not null;" json:"type"`
	Info       string `gorm:"not null;" json:"info"`
	UpdateTime int64  `gorm:"not null;" json:"update_time"`
	UpdatedBy  int    `gorm:"not null;" json:"updated_by"`
	Extra      string `gorm:"not null;type:text" json:"extra"`
}

AppTopology ...

func (*AppTopology) String

func (t *AppTopology) String() string

func (AppTopology) TableName

func (AppTopology) TableName() string

TableName ...

type AppUserRelation

type AppUserRelation struct {
	ID        int    `json:"id" gorm:"not null;column:id"` // id类型?
	AppName   string `json:"appName" gorm:"not null;column:app_name"`
	UserName  string `json:"userName" gorm:"not null;column:user_name"`
	UpdatedAt int64  `json:"updatedAt" gorm:"not null;column:updated_at"`
}

AppUserRelation ..

func (*AppUserRelation) TableName

func (t *AppUserRelation) TableName() string

TableName ..

type AppViewHistory

type AppViewHistory struct {
	gorm.Model
	UID     uint   `json:"uid"`
	Aid     uint   `json:"aid"`
	AppName string `json:"appName"`
}

AppViewHistory 应用浏览历史记录

func (AppViewHistory) TableName

func (AppViewHistory) TableName() string

TableName ..

type Board

type Board struct {
	ID        int        `gorm:"not null;" json:"id"`
	Name      string     `gorm:"not null;" json:"name"`
	Src       string     `gorm:"not null;" json:"src"`
	MetaData  MetaData   `gorm:"not null;type:json" json:"metaData"`
	IsEnable  bool       `gorm:"not null;" json:"isEnable"`
	IsCommon  bool       `gorm:"not null;" json:"isCommon"`
	CreatedAt int64      `gorm:"not null;" json:"createdAt"`
	UpdatedAt int64      `gorm:"not null;" json:"updatedAt"`
	DeletedAt *time.Time `gorm:"index" json:"deletedAt"`
}

Board ...

func (*Board) TableName

func (t *Board) TableName() string

TableName ..

type BoardAuth

type BoardAuth struct {
	ID        int   `gorm:"not null;" json:"id"`
	Did       int   `gorm:"not null;" json:"did"`
	UID       int   `gorm:"not null;" json:"uid"`
	CreatedAt int64 `gorm:"not null;" json:"createdAt"`
}

BoardAuth ..

func (*BoardAuth) TableName

func (t *BoardAuth) TableName() string

TableName ..

type CasbinGroupType added in v0.2.0

type CasbinGroupType string

type CasbinPolicyAuth added in v0.2.0

type CasbinPolicyAuth struct {
	gorm.Model
	Sub  string           `gorm:"not null;"json:"sub"`
	Obj  string           `gorm:"type:varchar(255);not null;"json:"obj"`
	Act  string           `gorm:"type:varchar(255);not null;"json:"act"`
	Type CasbinPolicyType `gorm:"not null;"json:"type"`
}

func (CasbinPolicyAuth) TableName added in v0.2.0

func (c CasbinPolicyAuth) TableName() string

type CasbinPolicyGroup added in v0.2.0

type CasbinPolicyGroup struct {
	gorm.Model
	GroupName string `gorm:"type:varchar(30);not null;" json:"group_name"`

	Uid     int    `gorm:"not null;index;"json:"uid"`
	AppName string `gorm:"type:varchar(255);not null;"json:"app_name"`
	AppEnv  string `gorm:"type:varchar(30);not null";json:"app_env"`
	URL     string `gorm:"type:varchar(255);not null;" json:"url"`

	Type string `gorm:"not null;"json:"type"`
}

func (CasbinPolicyGroup) TableName added in v0.2.0

func (c CasbinPolicyGroup) TableName() string

type CasbinPolicyObject added in v0.2.0

type CasbinPolicyObject struct {
	URL     *string `json:"url,omitempty"`
	AppName *string `json:"app_name,omitempty"`
	Menu    *string `json:"menu,omitempty"`
}

func (*CasbinPolicyObject) Scan added in v0.2.0

func (c *CasbinPolicyObject) Scan(src interface{}) error

func (CasbinPolicyObject) Value added in v0.2.0

func (c CasbinPolicyObject) Value() (driver.Value, error)

type CasbinPolicyType added in v0.2.0

type CasbinPolicyType string

type ChangeLog

type ChangeLog struct {
	Add     []string `json:"A"`
	Delete  []string `json:"D"`
	Modify  []string `json:"M"`
	Replace []string `json:"R"`
}

变化文件状态集合

func (*ChangeLog) ToString

func (c *ChangeLog) ToString() string

ToString ...

type CmcCnt

type CmcCnt struct {
	DayTime string `json:"day_time" gorm:"day_time"`
	Cnt     int    `gorm:"cnt" json:"cnt"`
}

CmcCnt ..

type CmcTpl

type CmcTpl struct {
	Id         int    `gorm:"not null;primary_key;AUTO_INCREMENT"json:"id"`
	TplType    string `gorm:"not null;"json:"tpl_type";query:"tpl_type"`
	Content    string `gorm:"not null;type:longtext"json:"content"`
	CreateTime int64  `gorm:"not null;"json:"create_time"`
	UpdateTime int64  `gorm:"not null;"json:"update_time"`
}

func (CmcTpl) TableName

func (CmcTpl) TableName() string

type CmdbSyncLog

type CmdbSyncLog struct {
	ID         int    `gorm:"primary_key" json:"id"`
	Aid        int    `json:"aid"` // 项目id
	Uid        int    `json:"uid"` // juno用户id
	Log        string `json:"log"` // 日志明细
	CreateTime int64  `json:"create_time"`
}

发布环境

func (CmdbSyncLog) TableName

func (CmdbSyncLog) TableName() string

TableName 表名

type CommitChange

type CommitChange struct {
	Before string
	After  string
	Ref    string
}

CommitChange ...

type ConfigResource added in v0.2.0

type ConfigResource struct {
	ID          uint   `gorm:"column:id;primary_key;auto_increment"`
	UID         uint   `gorm:"column:uid;"`       // 创建人
	IsGlobal    bool   `gorm:"column:is_global;"` // 是否是全局资源
	Name        string `gorm:"column:name;type:varchar(50);"`
	Env         string `gorm:"column:env;type:varchar(30);"`
	ZoneCode    string `gorm:"column:zone_code;type:varchar(50);"`
	Description string `gorm:"column:description;"`
	Visible     bool   `gorm:"column:visible;"`

	Tags   []ConfigResourceTag   `gorm:"foreignKey:ConfigResourceID"`
	Zone   Zone                  `gorm:"foreignKey:ZoneCode;association_foreignkey:ZoneCode;association_autoupdate:false"`
	User   User                  `gorm:"foreignKey:Uid;association_foreignkey:UID;association_autoupdate:false"`
	Values []ConfigResourceValue `gorm:"foreignKey:ConfigResourceID;association_autoupdate:false"`
}

func (ConfigResource) TableName added in v0.2.0

func (ConfigResource) TableName() string

type ConfigResourceTag added in v0.2.0

type ConfigResourceTag struct {
	ID               uint   `gorm:"column:id;primary_key;auto_increment"`
	ConfigResourceID uint   `gorm:"column:config_resource_id;"`
	Value            string `gorm:"column:value;type:varchar(30)"`
}

ConfigResourceTag 资源标签

func (ConfigResourceTag) TableName added in v0.2.0

func (ConfigResourceTag) TableName() string

type ConfigResourceValue added in v0.2.0

type ConfigResourceValue struct {
	ID               uint       `gorm:"column:id;primary_key;auto_increment"`
	ConfigResourceID uint       `gorm:"column:config_resource_id;"`
	Value            string     `gorm:"column:value;type:text;"`
	CreatedAt        time.Time  `gorm:"column:created_at;"`
	DeletedAt        *time.Time `gorm:"column:deleted_at;"`
}

func (ConfigResourceValue) TableName added in v0.2.0

func (ConfigResourceValue) TableName() string

type Configuration added in v0.2.0

type Configuration struct {
	ID          uint       `gorm:"column:id;primary_key" json:"id"`
	AID         uint       `gorm:"column:aid" json:"aid"`
	Name        string     `gorm:"column:name;type:varchar(20)" json:"name"`
	Content     string     `gorm:"column:content;type:longtext" json:"content"`
	Format      string     `gorm:"column:format;type:varchar(20)" json:"format"` // Yaml/Toml
	Env         string     `gorm:"column:env;type:varchar(20)" json:"env"`       // 环境
	Zone        string     `gorm:"column:zone;type:varchar(50)" json:"zone"`     // 机房Zone
	Version     string     `gorm:"column:version;type:varchar(50)" json:"version"`
	CreatedAt   time.Time  `gorm:"column:created_at" json:"created_at"`
	UpdatedAt   time.Time  `gorm:"column:updated_at" json:"updated_at"`
	DeletedAt   *time.Time `gorm:"column:deleted_at" json:"deleted_at"`
	PublishedAt *time.Time `gorm:"column:published_at" json:"published_at"` // 未发布/发布时间
}

Configuration Application configuration

func (Configuration) FileName added in v0.2.0

func (c Configuration) FileName() string

FileName ..

func (Configuration) TableName added in v0.2.0

func (Configuration) TableName() string

TableName ..

type ConfigurationHistory added in v0.2.0

type ConfigurationHistory struct {
	ID              uint       `gorm:"column:id;primary_key" json:"id"`
	AccessTokenID   uint       `gorm:"access_token_id" json:"access_token_id"` // AccessToken 授权ID
	UID             uint       `gorm:"column:uid" json:"uid"`                  // 操作用户ID
	ConfigurationID uint       `gorm:"column:configuration_id" json:"configuration_id"`
	ChangeLog       string     `gorm:"column:change_log;type:longtext" json:"change_log"` // 变更说明文字
	Content         string     `gorm:"column:content;type:longtext" json:"content"`       // 配置内容
	Version         string     `gorm:"column:version;type:varchar(50)" json:"version"`    // 版本号
	CreatedAt       time.Time  `gorm:"column:created_at" json:"created_at"`
	DeletedAt       *time.Time `gorm:"column:deleted_at" json:"deleted_at"`

	User             *User                           `json:"-" gorm:"foreignKey:UID;association_foreignkey:Uid"`
	AccessToken      *AccessToken                    `json:"-" gorm:"foreignKey:AccessTokenID;association_foreignkey:ID"`
	Configuration    *Configuration                  `json:"-" gorm:"foreignKey:ConfigurationID;"`
	ResourceRelation []ConfigurationResourceRelation `json:"-" gorm:"association_foreignkey:ConfigurationHistoryID"`
}

ConfigurationHistory Application configuration release history version

func (ConfigurationHistory) TableName added in v0.2.0

func (ConfigurationHistory) TableName() string

TableName ..

type ConfigurationPublish added in v0.2.0

type ConfigurationPublish struct {
	ID                     uint      `gorm:"column:id;primary_key" json:"id"`
	UID                    uint      `gorm:"column:uid" json:"uid"` // 操作用户ID
	ConfigurationID        uint      `gorm:"column:configuration_id" json:"configuration_id"`
	ConfigurationHistoryID uint      `gorm:"column:configuration_history_id" json:"configuration_history_id"`
	ApplyInstance          string    `gorm:"column:apply_instance" json:"apply_instance"`
	FilePath               string    `gorm:"column:file_path" json:"file_path"`
	CreatedAt              time.Time `gorm:"column:created_at" json:"created_at"`

	User                 *User                 `json:"-" gorm:"foreignKey:UID;association_foreignkey:Uid"`
	Configuration        *Configuration        `json:"-" gorm:"foreignKey:ConfigurationID;"`
	ConfigurationHistory *ConfigurationHistory `json:"-" gorm:"foreignKey:ConfigurationHistoryID;association_foreignkey:configuration_history_id"`
}

ConfigurationPublish Publish record

func (ConfigurationPublish) TableName added in v0.2.0

func (ConfigurationPublish) TableName() string

TableName ..

type ConfigurationResourceRelation added in v0.2.0

type ConfigurationResourceRelation struct {
	ID                     uint       `gorm:"column:id;primary_key" json:"id"`
	CreatedAt              time.Time  `gorm:"column:created_at" json:"created_at"`
	DeletedAt              *time.Time `gorm:"column:deleted_at" json:"deleted_at"`
	ConfigurationHistoryID uint       `gorm:"column:configuration_history_id" json:"configuration_history_id"` // 配置版本ID
	ConfigResourceValueID  uint       `gorm:"column:config_resource_value_id" json:"config_resource_value_id"` // 配置资源值ID
}

ConfigurationResourceRelation relate configuration and resource

func (ConfigurationResourceRelation) TableName added in v0.2.0

TableName ..

type ConfigurationStatus added in v0.2.0

type ConfigurationStatus struct {
	ID                     uint      `gorm:"column:id;primary_key" json:"id"`
	ConfigurationID        uint      `gorm:"column:configuration_id" json:"configuration_id"`
	ConfigurationPublishID uint      `gorm:"column:configuration_publish_id" json:"configuration_publish_id"`
	HostName               string    `gorm:"column:host_name" json:"host_name"`
	Used                   uint      `gorm:"column:used" json:"used"`               // 命令行是否使用了配置路径
	Synced                 uint      `gorm:"column:synced" json:"synced"`           // 配置下发是否成功
	TakeEffect             uint      `gorm:"column:take_effect" json:"take_effect"` // 配置是否生效
	CreatedAt              time.Time `gorm:"column:created_at" json:"created_at"`
	UpdateAt               time.Time `gorm:"column:update_at" json:"update_at"`

	ConfigurationPublish *ConfigurationPublish `json:"-" gorm:"foreignKey:ConfigurationPublishID;association_foreignkey:ID"`
}

ConfigurationStatus ..

func (ConfigurationStatus) TableName added in v0.2.0

func (ConfigurationStatus) TableName() string

TableName ..

type FlowContainer

type FlowContainer struct {
	ID     uint `gorm:"primary_key"`
	FlowID int  `json:"flow_id"`
	K8sDid int  `json:"k8s_did"`
}

FlowContainer ...

func (FlowContainer) TableName

func (FlowContainer) TableName() string

TableName ...

type GitlabEvent

type GitlabEvent struct {
	Gid        int // project id
	Uid        int
	UserName   string
	UserEmail  string
	UserAvatar string
	Refs       string
	Id         int
	Changes    string
	CreateTime int
}

GitlabEvent ...

func (GitlabEvent) TableName

func (GitlabEvent) TableName() string

TableName ...

type GitlabEventList

type GitlabEventList struct {
	Gid      int    `json:"gid"` // project id
	UserName string `json:"userName" gorm:"user_name"`
	Changes  string
}

GitlabEventList ...

type GovernConfigData

type GovernConfigData struct {
	Config struct {
		Enable bool   `json:"enable"`
		Weight int32  `json:"weight"`
		Group  string `json:"group"`
	} `json:"config"`
}

func (*GovernConfigData) JsonString

func (v *GovernConfigData) JsonString() string

type GovernRegData

type GovernRegData struct {
	Name    string                 `json:"name"`
	Schema  string                 `json:"schema"`
	Address string                 `json:"address"`
	Labels  map[string]interface{} `json:"labels"`
}

type ListProviderEvents

type ListProviderEvents struct {
	Events     []ProviderRegisterEvent `json:"events"`
	NextCursor string                  `json:"nextCursor"`
}

type ListProviderEventsReq

type ListProviderEventsReq struct {
	Cursor string `json:"cursor"`
	Number int    `json:"num"`
	Type   RegisterType
}

type ListProviderEventsResp

type ListProviderEventsResp struct {
	Code int                `json:"code"`
	Msg  string             `json:"msg"`
	Data ListProviderEvents `json:"data"`
}

type MetaData

type MetaData struct {
	Width      int `gorm:"not null;" json:"width"`
	Height     int `gorm:"not null;" json:"height"`
	MarginLeft int `gorm:"not null;" json:"marginLeft"`
	MarginTop  int `gorm:"not null;" json:"marginTop"`
}

MetaData ..

func (*MetaData) Scan

func (c *MetaData) Scan(input interface{}) error

Scan ..

func (MetaData) Value

func (c MetaData) Value() (driver.Value, error)

Value ..

type Model

type Model struct {
	Id         int   `gorm:"not null;"json:"id"`
	CreateTime int64 `gorm:"not null;"json:"create_time"`
	UpdateTime int64 `gorm:"not null;"json:"update_time"`
	DeleteTime int64 `gorm:"not null;"json:"delete_time"`
}

type Node

type Node struct {
	Id         int    `gorm:"not null;"json:"id"`
	HostName   string `gorm:"not null;"json:"host_name" `
	Ip         string `json:"ip" gorm:"not null;column:ip"`
	CreateTime int64  `gorm:"not null;"json:"create_time"`
	UpdateTime int64  `gorm:"not null;"json:"update_time"`
	Env        string `gorm:"not null;"json:"env"`
	RegionCode string `json:"region_code"gorm:"not null"`
	RegionName string `json:"region_name"gorm:"not null"`
	ZoneCode   string `json:"zone_code"gorm:"not null"`
	ZoneName   string `json:"zone_name"gorm:"not null"`

	AgentHeartbeatTime int64 `gorm:"not null;"json:"agent_heartbeat_time"`
	ProxyHeartbeatTime int64 `gorm:"not null;"json:"proxy_heartbeat_time"`

	NodeType     int    `gorm:"not null;"json:"node_type"`     // 1为接口,2为后台添加,3为juno agent
	AgentType    int    `gorm:"not null;"json:"agent_type"`    // agent类型
	AgentVersion string `gorm:"not null;"json:"agent_version"` // agent version
	ProxyType    int    `gorm:"not null;"json:"proxy_type"`    // proxy 类型
	ProxyVersion string `gorm:"not null;"json:"proxy_version"` // proxy version
}

node节点,可以由juno agent进行上报,也可以由接口进行上报

func (Node) TableName

func (Node) TableName() string

type NodeCnt

type NodeCnt struct {
	DayTime string `json:"day_time" gorm:"day_time"`
	Cnt     int    `gorm:"cnt"json:"cnt"`
}

type NodeStatus

type NodeStatus struct {
	IP        string `json:"ip"`
	HostName  string `json:"host_name"`
	StartTime string `json:"start_time"`
	KeyStatus string `json:"key_status"`
	Env       string `json:"env"`
}

type OpsSupervisorConfig

type OpsSupervisorConfig struct {
	ID           int    `gorm:"primary_key" json:"id"`
	Aid          int    // 项目ID
	AppName      string // 项目名称
	OpsAppName   string // 项目发布名称
	ZoneCode     string
	AccessKey    string // 接口公钥
	AccessSecret string // 接口私钥
	CreateTime   int64
	UpdateTime   int64
}

func (OpsSupervisorConfig) TableName

func (OpsSupervisorConfig) TableName() string

TableName 表名

type Option

type Option struct {
	Id          int    `gorm:"not null;primary_key;AUTO_INCREMENT"json:"optionId"`
	OptionTitle string `gorm:"not null;"json:"optionTitle"`
	OptionName  string `gorm:"not null;"json:"optionName"`
	OptionValue string `gorm:"not null;"json:"optionValue"`
	CreateTime  int64  `gorm:"not null;comment:'创建时间'" json:"create_time"`
	UpdateTime  int64  `gorm:"not null;comment:'更新时间'"json:"update_time"`
}

Option struct .

func (Option) TableName

func (m Option) TableName() string

TableName 获取对应数据库表名.

type PProf

type PProf struct {
	ID         int         `gorm:"not null;primary_key" json:"id"`
	Type       string      `gorm:"not null;"json:"type"`
	SceneId    string      `gorm:"not null;"json:"sceneId"`
	AppName    string      `gorm:"not null;"json:"appName"`   // 项目id
	Aid        int         `gorm:"not null;"json:"aid"`       // 项目id
	FileInfo   string      `gorm:"not null;"json:"fileInfo"`  // 环境类型名称
	ZoneCode   string      `gorm:"not null;"json:"zone_code"` //  环境类型
	Env        string      `gorm:"not null;"json:"env"`       //  环境类型
	Ext        string      `gorm:"not null;"json:"ext"`
	Remark     string      `gorm:"not null;"json:"remark"`
	HostName   string      `gorm:"not null;"json:"hostName"`
	CreateTime int64       `gorm:""json:"create_time"`
	UpdateTime int64       `gorm:""json:"update_time"`
	DeleteTime int64       `gorm:"index"json:"delete_time"`
	PprofList  []PprofInfo `gorm:"-"json:"pprofList"`
}

发布环境

func (PProf) TableName

func (PProf) TableName() string

TableName 表名

type PProfFileInfo

type PProfFileInfo struct {
	Url      string `json:"url"`
	FileType string `json:"fileType"`
}

type PProfOssFile

type PProfOssFile struct {
	FileType    string `json:"fileType"`
	OriginalRid string `json:"originalRid"`
	OriginalMd5 string `json:"originalMd5"`
	Original    string `json:"original"`
}

type PProfReqList

type PProfReqList struct {
	ZoneCode string `form:"zoneCode"`
	AppName  string `form:"appName"`
	HostName string `form:"hostName"`
	Env      string `form:"env"`
}

type PProfViewModel

type PProfViewModel struct {
	PProf
	HostName string `json:"host_name"` // 主机名
}

type PprofInfo

type PprofInfo struct {
	Id   int    `json:"id"`
	Type string `json:"type"`
	Url  string `json:"url"`
}

type ProviderRegisterEvent

type ProviderRegisterEvent struct {
	ID        uint         `gorm:"primary_key" json:"id"`
	CreatedAt time.Time    `json:"createdAt"`
	UpdatedAt time.Time    `json:"updatedAt"`
	DeletedAt *time.Time   `sql:"index" json:"deletedAt"`
	AppName   string       `json:"appName"`
	Schema    string       `json:"schema"`
	Address   string       `json:"address"`
	Type      RegisterType `json:"type"`
}

type RegAllData

type RegAllData struct {
	Register ServerRegData    `json:"register"`
	Config   ServerConfigData `json:"config"`
}

type RegInfoOutPut

type RegInfoOutPut struct {
	ID         int    `json:"id"`
	AppName    string `json:"app_name"`
	HostName   string `json:"host_name"`
	RegIP      string `json:"ip" gorm:"column:ip"`
	RegKey     string `json:"reg_key"`
	UpdateTime string `json:"update_time"`
	StartTime  string `json:"start_time"`
	VcsInfo    string `json:"vcs_info"`
}

type RegisterType

type RegisterType int8

type ReqCheck

type ReqCheck struct {
	InstallType int `json:"installType"`
}

type ReqProfile

type ReqProfile struct {
	ZoneCode string `form:"zoneCode"`
	AppName  string `form:"appName"`
	HostName string `form:"hostName"`
	Env      string `form:"env"`
}

type ReqSysConfig

type ReqSysConfig struct {
	Id      int    `gorm:"not null;"json:"id"`
	SysType int    `json:"sysType"`
	SetInt  int    `json:"setInt"`
	SetCate string `gorm:"not null;column:set_cate" json:"setCate"`
	SetStr  string `json:"setStr"`
}

type ServerConfigData

type ServerConfigData struct {
	ConfigKey   string           `json:"config_key"`
	ConfigValue GovernConfigData `json:"config_value"`
}

type ServerRegData

type ServerRegData struct {
	RegKey   string        `json:"reg_key"`
	RegValue GovernRegData `json:"reg_value"`
}

type SystemConfig

type SystemConfig struct {
	Name       string `gorm:"not null;column:name;type:varchar(50);primary_key" json:"name"`
	Content    string `gorm:"not null;column:content;type:longtext" json:"content"`
	CreateTime int64  `gorm:"not null;"json:"create_time"`
	UpdateTime int64  `gorm:"not null;"json:"update_time"`
}

func (*SystemConfig) BeforeCreate added in v0.2.0

func (s *SystemConfig) BeforeCreate() error

func (*SystemConfig) BeforeUpdate added in v0.2.0

func (s *SystemConfig) BeforeUpdate() error

func (SystemConfig) TableName

func (SystemConfig) TableName() string

type ToolInfo

type ToolInfo struct {
	Id         uint64 `gorm:"not null;primary_key;comment:'id'"`
	Name       string `gorm:"not null;comment:'工具名'"json:"name"`
	Url        string `gorm:"not null;comment:'工具地址'"json:"url"`
	PicUrl     string `gorm:"not null;comment:'图片地址'"json:"picUrl"`
	Desc       string `gorm:"not null;comment:'工具描述'"json:"desc"`
	CreateTime int64  `gorm:"not null;comment:'创建时间'"json:"createTime"`
}

ToolInfo ...

func (ToolInfo) TableName

func (ToolInfo) TableName() string

TableName ...

type User

type User struct {
	Uid        int    `gorm:"not null;primary_key;AUTO_INCREMENT"json:"uid"`
	Oaid       int    `gorm:"not null;comment:'oa uid'"json:"id"`
	Username   string `gorm:"not null;comment:'用户名'"json:"username"`
	Nickname   string `gorm:"not null;comment:'昵称'"json:"nickname"`
	Token      string `gorm:"not null;comment:'token信息'"json:"token"`
	Secret     string `gorm:"not null;comment:'秘钥'"json:"secret"`
	Email      string `gorm:"not null;comment:'email'"json:"email"`
	Avatar     string `gorm:"not null;comment:'avatart'"json:"avatar"`
	WebUrl     string `gorm:"not null;comment:'注释'"json:"webUrl"`
	State      string `gorm:"not null;comment:'注释'"json:"state"`
	Hash       string `gorm:"not null;comment:'注释'"json:"hash"`
	CreateTime int64  `gorm:"not null;comment:'注释'"json:"createTime"`
	UpdateTime int64  `gorm:"not null;comment:'注释'"json:"updateTime"`

	Oauth    string `gorm:"not null;"json:"oauth"`   // 来源
	OauthId  string `gorm:"not null;"json:"oauthId"` // 来源id
	Password string `gorm:"not null;comment:'注释'"json:"password"`
	// open source user data
	CurrentAuthority string `json:"currentAuthority"`
	Access           string `json:"access"`

	UserGroup *CasbinPolicyGroup `gorm:"foreignKey:Uid;association_foreignkey:Uid"`
	// contains filtered or unexported fields
}

swagger:model user

func (*User) IsLogin added in v0.2.0

func (u *User) IsLogin() bool

func (User) TableName

func (User) TableName() string

TableName 指定Menu结构体对应的表名

func (*User) TransformUserInfo

func (u *User) TransformUserInfo() UserInfo

type UserInfo

type UserInfo struct {
	// the id for this user.
	//
	// required: true
	// oa uid
	Oaid int `json:"oaid"`
	// gitlab uid
	Uid int `json:"uid"`

	// Login is the username for this user.
	//
	// required: true
	Username string `json:"username"`
	Nickname string `json:"nickname"`

	// Token is the oauth2 token.
	Token string `json:"token"`

	// Secret is the oauth2 token secret.
	Secret string `json:"secret"`

	// Email is the email address for this user.
	// required: true
	Email string `json:"email"`

	// the avatar url for this user.
	Avatar string `json:"avatarUrl"`
	WebUrl string `json:"webUrl"`
	State  string `json:"state"`

	// Hash is a unique token used to sign tokens.
	Hash string `json:"hash"`

	// DEPRECATED Admin indicates the user is a system administrator.
	CreateTime int64 `json:"create_time"`
	UpdateTime int64 `json:"update_time"`

	Authenticated bool   `form:"-" db:"-" json:"-"`
	Access        string `json:"access"`
}

UserInfo ...

type UserList added in v0.2.0

type UserList []User

type UserNameJSON added in v0.2.0

type UserNameJSON []string

UserNameJSON ..

func (*UserNameJSON) Scan added in v0.2.0

func (c *UserNameJSON) Scan(input interface{}) error

Scan ..

func (UserNameJSON) Value added in v0.2.0

func (c UserNameJSON) Value() (driver.Value, error)

Value ..

type UserRelation

type UserRelation struct {
	ID         int   `gorm:"not null;comment:'注释'"json:"id"`
	Uid        int   `gorm:"not null;comment:'注释'"json:"uid"`
	Bid        int   `gorm:"not null;comment:'注释'"json:"bid"`
	Type       int   `gorm:"not null;comment:'注释'"json:"type"`
	CreateTime int64 `gorm:"not null;comment:'注释'"json:"createTime"`
	UpdateTime int64 `gorm:"not null;comment:'注释'"json:"updateTime"`
	DeleteTime int64 `gorm:"not null;comment:'注释'"json:"deleteTime"`
}

UserRelation for relation between user and other cases

func (UserRelation) TableName

func (UserRelation) TableName() string

TableName ...

type UserVisitedApp

type UserVisitedApp struct {
	ID          int
	AppName     string `json:"app_name" gorm:"app_name"`
	UserName    string `json:"user_name" gorm:"user_name"`
	VisitedTime int64  `json:"visited_time" gorm:"column:visited_time"`
}

func (UserVisitedApp) TableName

func (UserVisitedApp) TableName() string

TableName ...

type Zone

type Zone struct {
	Id         int    `gorm:"not null;comment:'注释'"json:"id"`
	Env        string `json:"env"gorm:"not null"`
	RegionCode string `json:"region_code"gorm:"not null"`
	RegionName string `json:"region_name"gorm:"not null"`
	ZoneCode   string `json:"zone_code"gorm:"not null"`
	ZoneName   string `json:"zone_name"gorm:"not null"`
	CreateTime int64  `gorm:"not null;comment:'注释'"json:"create_time"`
	UpdateTime int64  `gorm:"not null;comment:'注释'"json:"update_time"`
	CreatedBy  int    `gorm:"not null;comment:'注释'"json:"created_by"`
	UpdatedBy  int    `gorm:"not null;comment:'注释'"json:"updated_by"`
}

ZoneCode ...

func (Zone) TableName

func (Zone) TableName() string

TableName 表名

Jump to

Keyboard shortcuts

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