db

package
v0.5.9 Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: Apache-2.0 Imports: 11 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 (
	CronTaskStatusWaiting    CronTaskStatus = "waiting"
	CronTaskStatusProcessing CronTaskStatus = "processing"
	CronTaskStatusSuccess    CronTaskStatus = "success"
	CronTaskStatusFailed     CronTaskStatus = "failed"
	CronTaskStatusTimeout    CronTaskStatus = "timeout"

	CronJobTypeNormal CronJobType = 0
	CronJobTypeSingle CronJobType = 1

	ExecuteTypeAuto   = 0 // 定时任务自动执行
	ExecuteTypeManual = 1 // 手动触发
)
View Source
const (
	StepTypeSubPipeline StepType = 1 // 子Pipeline类型,当前Step拥有多个子Step
	StepTypeJob                  = 2 // 任务类型,当前Step执行某个任务

	JobGitPull   TestJobType = "git_pull"
	JobUnitTest  TestJobType = "unit_test"
	JobCodeCheck TestJobType = "code_check"
	JobHttpTest  TestJobType = "http_test"
	JobGrpcTest  TestJobType = "grpc_test"

	TestTaskStatusPending TestTaskStatus = "pending"
	TestTaskStatusRunning                = "running"
	TestTaskStatusFailed                 = "failed"
	TestTaskStatusSuccess                = "success"

	TestStepStatusWaiting TestStepStatus = "waiting"
	TestStepStatusRunning                = "running"
	TestStepStatusFailed                 = "failed"
	TestStepStatusSuccess                = "success"
)
View Source
const (
	GoPkgToml = "/Gopkg.lock"
)

GoPkgToml ...

Variables

View Source
var (
	CasbinPolicyTypeMenu    CasbinPolicyType = "menu"
	CasbinPolicyTypeApp     CasbinPolicyType = "app"
	CasbinPolicyTypeAPI     CasbinPolicyType = "api"
	CasbinPolicyTypeMonitor CasbinPolicyType = "monitor" // Grafana权限

	// 监控面板权限
	MonitorPermWrite = "monitor:write"

	AppPermAppRead            = "app:read"
	AppPermConfigRead         = "config:read"
	AppPermConfigWrite        = "config:write"
	AppPermConfigReadInstance = "config:readInstance"
	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 {
	ModelT
	Name   string `json:"name" gorm:"type:varchar(32);uniqueIndex:idx_unique_name;"`
	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 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"`
	OperatorType  string `gorm:"not null;default:'user'" json:"operator_type"`   // 用户类型 (user or openapi)
	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" json:"-"`
	GrpcProtos []GrpcProto `gorm:"foreignKey:AppName" 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;index"`
	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 float64 `gorm:"not null;" json:"create_time"`
	UpdateTime float64 `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 {
	ModelT
	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 {
	ModelT
	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 {
	ModelT
	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 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:ID"`
	Zone   Zone                  `gorm:"foreignKey:ZoneCode;association_autoupdate:false"`
	User   User                  `gorm:"foreignKey:username;association_autoupdate:false"`
	Values []ConfigResourceValue `gorm:"foreignKey:ID"`
}

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        gorm.DeletedAt `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(32)" 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"`
	AccessTokenID uint           `gorm:"access_token_id" json:"access_token_id"` // AccessToken 授权ID
	UID           uint           `gorm:"column:uid" json:"uid"`                  // 操作用户ID
	UpdatedAt     time.Time      `gorm:"column:updated_at" json:"updated_at"`
	DeletedAt     gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
	PublishedAt   *time.Time     `gorm:"column:published_at" json:"published_at"` // 未发布/发布时间
	LockUid       uint           `gorm:"column:lock_uid" json:"lock_uid"`         // 正在编辑用户
	LockAt        *time.Time     `gorm:"column:lock_at" json:"lock_at"`

	App AppInfo `gorm:"foreignKey:aid" json:"-"`
}

Configuration Application configuration

func (Configuration) FileName added in v0.2.0

func (c Configuration) FileName() string

ProtoID ..

func (Configuration) TableName added in v0.2.0

func (Configuration) TableName() string

TableName ..

type ConfigurationClusterStatus added in v0.4.3

type ConfigurationClusterStatus 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"`
	ClusterName            string    `gorm:"column:cluster_name" json:"cluster_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"`
}

ConfigurationClusterStatus ..

func (ConfigurationClusterStatus) TableName added in v0.4.3

func (ConfigurationClusterStatus) 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       gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`

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

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
	AccessTokenID uint `gorm:"access_token_id" json:"access_token_id"` // AccessToken 授权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"`
	Configuration        *Configuration        `json:"-" gorm:"foreignKey:ConfigurationID"`
	ConfigurationHistory *ConfigurationHistory `json:"-" gorm:"foreignKey:ConfigurationHistoryID"`
}

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"`
}

ConfigurationStatus ..

func (ConfigurationStatus) TableName added in v0.2.0

func (ConfigurationStatus) TableName() string

TableName ..

type CronJob added in v0.4.0

type CronJob struct {
	ModelT
	Name          string      `gorm:"column:name"`
	Uid           uint        `gorm:"column:uid"`
	AppName       string      `gorm:"column:app_name"`
	Env           string      `gorm:"column:env"`
	Zone          string      `gorm:"column:zone"`
	Timeout       uint        `gorm:"column:timeout"`
	RetryCount    uint        `gorm:"column:retry_count"`
	RetryInterval uint        `gorm:"column:retry_interval"`
	Script        string      `gorm:"column:script"`
	Enable        bool        `gorm:"column:enable"`
	Nodes         StringArray `gorm:"type:json"`
	JobType       CronJobType

	User       User           `gorm:"foreignKey:Uid"`
	Timers     []CronJobTimer `gorm:"foreignKey:ID"`
	LatestTask *CronTask      `gorm:"foreignKey:ID"`
}

type CronJobTimer added in v0.4.0

type CronJobTimer struct {
	ModelT
	JobID uint   `gorm:"column:job_id"`
	Cron  string `gorm:"column:cron"` // crontab-like DSL

	Job CronJob `gorm:"foreignKey:job_id"`
}

type CronJobType added in v0.4.0

type CronJobType int

type CronTask added in v0.4.0

type CronTask struct {
	ID          uint64         `gorm:"column:id;primary_key"`
	JobID       uint           `gorm:"column:job_id;index"`
	Node        string         `gorm:"column:node"`
	Env         string         `gorm:"column:env"`
	Zone        string         `gorm:"column:zone"`
	Status      CronTaskStatus `gorm:"column:status"`
	Timeout     uint           `gorm:"column:timeout"`
	ExecutedAt  *time.Time     `gorm:"column:executed_at"`
	FinishedAt  *time.Time     `gorm:"column:finished_at"`
	RetryCount  uint           `gorm:"column:retry_count"`
	Log         string         `gorm:"column:log;type:longtext"`
	Script      string         `gorm:"column:script"`
	ExecuteType int            `gorm:"execute_type"` // 0: 定时执行 1: 手动触发
	CreatedAt   time.Time
	UpdatedAt   time.Time
	DeletedAt   *time.Time `sql:"index"`

	Job CronJob `gorm:"foreignKey:job_id"`
}

type CronTaskStatus added in v0.4.0

type CronTaskStatus string

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 GrpcProto added in v0.3.0

type GrpcProto struct {
	ModelT

	AppName     string
	FileName    string
	PackageName string

	Services []GrpcProtoService `gorm:"foreignKey:ProtoID"`
}

func (GrpcProto) TableName added in v0.3.0

func (GrpcProto) TableName() string

type GrpcProtoService added in v0.3.0

type GrpcProtoService struct {
	ModelT

	ProtoID uint
	Name    string

	Proto   GrpcProto           `gorm:"foreignKey:ProtoID"`
	Methods []GrpcServiceMethod `gorm:"foreignKey:ServiceID"`
}

func (GrpcProtoService) TableName added in v0.3.0

func (GrpcProtoService) TableName() string

type GrpcServiceMethod added in v0.3.0

type GrpcServiceMethod struct {
	ModelT

	ServiceID     uint        `gorm:"column:service_id;"`
	Name          string      `gorm:"column:name;not null;"`
	MethodComment string      `gorm:"column:method_comment;"`
	InputName     string      `gorm:"column:input_name;not null;"`
	InputType     ProtoFields `gorm:"column:input_type;not null;type:json"`  // 入参类型描述
	OutputType    ProtoFields `gorm:"column:output_type;not null;type:json"` // 返回值类型描述
	OutputName    string      `gorm:"column:output_name;not null;"`

	Service   GrpcProtoService `gorm:"foreignKey:service_id"`
	TestCases []GrpcTestCase   `gorm:"foreignKey:MethodID"`
}

Protobuf Method 描述,通过解析 PB 文件获取到 PB 描述

func (GrpcServiceMethod) TableName added in v0.3.0

func (GrpcServiceMethod) TableName() string

type GrpcTestCase added in v0.3.0

type GrpcTestCase struct {
	ModelT
	MethodID uint
	Uid      uint
	Name     string
	Input    string        `gorm:"type:longtext;"`
	Metadata ProtoMetadata `gorm:"type:longtext;"`
	Script   string        `gorm:"type:longtext;"`

	Method GrpcServiceMethod `gorm:"foreignKey:MethodID"`
}

GRPC 测试用例

func (GrpcTestCase) TableName added in v0.3.0

func (GrpcTestCase) TableName() string

type GrpcTestLog added in v0.3.0

type GrpcTestLog struct {
	ModelT

	MethodID uint

	OperatorType string // 执行方的类型
	OperatorID   uint   // 执行方ID

	Input      string        `gorm:"type:longtext;"`
	Output     string        `gorm:"type:longtext;"`
	Status     string        `gorm:"type:varchar(20);"` // 状态
	Error      string        `gorm:"type:longtext;"`
	TimeCost   int64         `gorm:"type:int unsigned;"`
	Addr       string        `gorm:"type:varchar(30)"` // 访问的地址
	Metadata   ProtoMetadata `gorm:"type:longtext;"`
	Script     string        `gorm:"type:longtext;"`
	TestPassed bool

	Method GrpcServiceMethod `gorm:"foreignKey:MethodID"`
}

GRPC 测试日志

func (GrpcTestLog) TableName added in v0.3.0

func (GrpcTestLog) TableName() string

type HttpTestCase added in v0.3.0

type HttpTestCase struct {
	ModelT
	CollectionID uint          `json:"collection_id"`
	Name         string        `json:"name"`
	URL          string        `json:"url"`
	Method       string        `json:"method"`
	Query        HttpTestParam `gorm:"type:json" json:"query"`
	Headers      HttpTestParam `gorm:"type:json" json:"headers"`
	ContentType  string        `json:"content_type"`
	Body         string        `json:"body"`
	Script       string        `gorm:"type:longtext;" json:"script"`

	Collection HttpTestCollection `gorm:"foreignKey:collection_id" json:"-"`
}

func (HttpTestCase) TableName added in v0.3.0

func (HttpTestCase) TableName() string

type HttpTestCollection added in v0.3.0

type HttpTestCollection struct {
	ModelT
	CreatedBy uint   `json:"created_by"` // 创建人ID
	AppName   string `json:"app_name"`
	Name      string `json:"name"`

	TestCases []HttpTestCase `gorm:"foreignKey:CollectionID" json:"-"`
}

func (HttpTestCollection) TableName added in v0.3.0

func (HttpTestCollection) TableName() string

type HttpTestLog added in v0.3.0

type HttpTestLog struct {
	ModelT

	OperatorType string // 执行人类型
	OperatorID   uint   // 执行人ID

	AppName string
	Name    string

	// Request
	URL         string
	Method      string
	Query       HttpTestParam `gorm:"type:json"`
	Headers     HttpTestParam `gorm:"type:json"`
	ContentType string
	Body        string `gorm:"type:longtext"`

	// Response
	ResponseBody    string         `gorm:"type:longtext"`
	ResponseHeaders MapStringArray `gorm:"type:json"`
	Size            int64
	Cost            int64
	Code            int
	Status          string
	Error           string
	TestLogs        MapStringString `gorm:"type:json"` // 测试脚本产生的Log
}

func (HttpTestLog) TableName added in v0.3.0

func (HttpTestLog) TableName() string

type HttpTestParam added in v0.3.0

type HttpTestParam []HttpTestParamItem

func (*HttpTestParam) Scan added in v0.3.0

func (h *HttpTestParam) Scan(val interface{}) error

func (HttpTestParam) Value added in v0.3.0

func (h HttpTestParam) Value() (val driver.Value, err error)

type HttpTestParamItem added in v0.4.0

type HttpTestParamItem struct {
	Key         string `json:"key"`
	Value       string `json:"value"`
	Description string `json:"description"`
}

type K8sPod added in v0.4.3

type K8sPod struct {
	// common field
	PodName           string    `json:"pod_name" gorm:"column:pod_name;primary_key"`           //名称
	Env               string    `json:"env" gorm:"column:env"`                                 //env
	Namespace         string    `json:"namespace" gorm:"column:namespace"`                     //namespace
	HostIp            string    `json:"host_ip" gorm:"column:host_ip"`                         //host_ip
	PodIp             string    `json:"pod_ip" gorm:"column:pod_ip"`                           //podIP
	NodeName          string    `json:"node_name" gorm:"column:node_name;index:idx_node_name"` //nodeName
	StartTime         time.Time `json:"start_time" gorm:"column:start_time"`                   //updateTime
	UpdateTime        time.Time `json:"update_time" gorm:"column:update_time"`                 //updateTime
	Image             string    `json:"image" gorm:"column:image"`                             //imageVersion
	Status            string    `json:"status" gorm:"column:status"`                           //status
	InstanceGroupID   string    `json:"instance_group_id" gorm:"column:instance_group_id"`     //appDeploymentId
	InstanceGroupName string    `json:"instance_group_name" gorm:"column:instance_group_name"` //appDeploymentName
	MD5               string    `json:"md5" gorm:"column:md5;index:idx_md5"`                   //body
	IsDel             int32     `json:"is_del" gorm:"column:is_del"`                           //id_del

	// customize label
	Aid      int32  `json:"aid" gorm:"column:aid;index:idx_aid"`               //appId
	AppName  string `json:"app_name" gorm:"column:app_name;index:idx_appname"` //appName
	ZoneCode string `json:"zone_code" gorm:"column:zone_code"`                 //idc_code
	Domain   string `json:"domain" gorm:"column:domain"`                       //zoneCode+Domain唯一标识一个集群
}

K8sPod ..

func (*K8sPod) Formatting added in v0.4.3

func (t *K8sPod) Formatting(zc, domain string, in *v1.Pod)

Formatting ..

func (*K8sPod) TableName added in v0.4.3

func (t *K8sPod) TableName() string

TableName ..

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 MapStringArray added in v0.3.0

type MapStringArray map[string][]string

func (*MapStringArray) Scan added in v0.3.0

func (h *MapStringArray) Scan(val interface{}) error

func (MapStringArray) Value added in v0.3.0

func (h MapStringArray) Value() (val driver.Value, err error)

type MapStringString added in v0.4.0

type MapStringString map[string]string

func (*MapStringString) Scan added in v0.4.0

func (h *MapStringString) Scan(val interface{}) error

func (MapStringString) Value added in v0.4.0

func (h MapStringString) Value() (val driver.Value, err error)

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 ModelT added in v0.5.0

type ModelT struct {
	ID        uint `gorm:"primary_key"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time `sql:"index"`
}

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 OAuthToken added in v0.3.0

type OAuthToken struct {
	*oauth2.Token
}

func (*OAuthToken) Scan added in v0.3.0

func (o *OAuthToken) Scan(input interface{}) error

Scan ..

func (OAuthToken) Value added in v0.3.0

func (o OAuthToken) Value() (driver.Value, error)

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 PProfViewModel

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

type PipelineGrpcTestCases added in v0.4.0

type PipelineGrpcTestCases []struct {
	Service  uint `json:"service"`
	Method   uint `json:"method"`
	TestCase uint `json:"testcase"`
}

func (*PipelineGrpcTestCases) Scan added in v0.4.0

func (d *PipelineGrpcTestCases) Scan(input interface{}) error

func (PipelineGrpcTestCases) Value added in v0.4.0

func (d PipelineGrpcTestCases) Value() (driver.Value, error)

type PprofInfo

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

type ProtoField added in v0.3.0

type ProtoField struct {
	JsonName    string      `json:"json_name"`
	Type        int32       `json:"type"`
	Label       int32       `json:"label"`
	Number      int32       `json:"number"`
	IsRepeated  bool        `json:"is_repeated"`
	MessageType ProtoFields `json:"message_type"`
	Comment     string      `json:"comment"`
}

type ProtoFields

type ProtoFields map[string]ProtoField

map: 字段名 => 类型描述

func (*ProtoFields) Scan

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

func (ProtoFields) Value

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

type ProtoMetadata added in v0.3.0

type ProtoMetadata []struct {
	Key         string `json:"key"`
	Value       string `json:"value"`
	Description string `json:"description"`
}

func (*ProtoMetadata) Scan added in v0.3.0

func (m *ProtoMetadata) Scan(input interface{}) error

func (ProtoMetadata) Value added in v0.3.0

func (m ProtoMetadata) Value() (driver.Value, error)

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 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 StepType added in v0.4.0

type StepType int

type StringArray added in v0.4.0

type StringArray []string

func (*StringArray) Scan added in v0.4.0

func (h *StringArray) Scan(val interface{}) error

func (StringArray) Value added in v0.4.0

func (h StringArray) Value() (val driver.Value, err error)

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(*gorm.DB) error

func (*SystemConfig) BeforeUpdate added in v0.2.0

func (s *SystemConfig) BeforeUpdate(*gorm.DB) error

func (SystemConfig) TableName

func (SystemConfig) TableName() string

type TestJobPayload added in v0.4.0

type TestJobPayload struct {
	Type    TestJobType     `json:"type"`
	Payload json.RawMessage `json:"payload"`
}

type TestJobType added in v0.4.0

type TestJobType string

type TestPipeline added in v0.4.0

type TestPipeline struct {
	ModelT
	Name               string
	AppName            string
	Env                string `gorm:"type:varchar(32)"`
	ZoneCode           string
	Branch             string
	CodeCheck          bool
	UnitTest           bool
	HttpTestCollection *int
	GrpcTestAddr       string
	GrpcTestCases      PipelineGrpcTestCases `gorm:"type:json"` // GRPC 测试用例列表
	CreatedBy          uint
	UpdatedBy          uint

	App AppInfo `gorm:"foreignKey:AppName" json:"-"`
}

func (*TestPipeline) TableName added in v0.4.0

func (*TestPipeline) TableName() string

type TestPipelineDesc added in v0.4.0

type TestPipelineDesc struct {
	Parallel bool               `json:"parallel"`
	Steps    []TestPipelineStep `json:"steps"`
}

func (TestPipelineDesc) JobCount added in v0.4.0

func (d TestPipelineDesc) JobCount() int

func (*TestPipelineDesc) Scan added in v0.4.0

func (d *TestPipelineDesc) Scan(input interface{}) error

func (TestPipelineDesc) ValidatePipelineDesc added in v0.4.0

func (d TestPipelineDesc) ValidatePipelineDesc() error

ValidatePipelineDesc 检查 TestPipelineDesc 是否有效

func (TestPipelineDesc) Value added in v0.4.0

func (d TestPipelineDesc) Value() (driver.Value, error)

type TestPipelineStep added in v0.4.0

type TestPipelineStep struct {
	Type        StepType          `json:"type"`         // Step Type
	Name        string            `json:"name"`         // MUST be unique under one TestPipelineDesc
	SubPipeline *TestPipelineDesc `json:"sub_pipeline"` // MUST be set when Type equals StepTypeSubPipeline
	JobPayload  *TestJobPayload   `json:"job_payload"`  // MUST be set when Type equals StepTypeJob
}

type TestPipelineStepStatus added in v0.4.0

type TestPipelineStepStatus struct {
	ModelT
	TaskID   uint
	StepName string
	Status   TestStepStatus // waiting, running, failed, success
	Logs     string         `gorm:"type:longtext"`
}

TestPipelineStepStatus 任务阶段状态

func (*TestPipelineStepStatus) TableName added in v0.4.0

func (*TestPipelineStepStatus) TableName() string

type TestPipelineTask added in v0.4.0

type TestPipelineTask struct {
	ModelT
	PipelineID uint
	Name       string
	AppName    string
	Branch     string
	Env        string           `gorm:"type:varchar(32)"`
	ZoneCode   string           `gorm:"type:varchar(32)"`
	Desc       TestPipelineDesc `gorm:"type:json"`
	Status     TestTaskStatus   // pending, running, failed, success
	Logs       string           `gorm:"type:longtext"`
	CreatedBy  uint

	StepStatus []TestPipelineStepStatus `gorm:"foreignKey:TaskID" json:"-"`
}

TestPipelineTask 任务下发执行的单位

func (*TestPipelineTask) TableName added in v0.4.0

func (*TestPipelineTask) TableName() string

type TestStepStatus added in v0.4.0

type TestStepStatus string

type TestTaskStatus added in v0.4.0

type TestTaskStatus 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"`
	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"`

	OauthToken OAuthToken `gorm:"type:json;comment:'OAuth Token 信息'" json:"-"`

	Groups []CasbinPolicyGroup `gorm:"foreignKey:Uid" json:"-"`
	// 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 UserConfig added in v0.4.3

type UserConfig struct {
	Id         uint64 `gorm:"not null;primary_key;AUTO_INCREMENT" json:"id"`
	Uid        int    `gorm:"not null;comment:'用户id'" json:"uid"`
	Aid        int    `gorm:"not null;comment:'应用id'" json:"aid"`
	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 (UserConfig) TableName added in v0.4.3

func (UserConfig) TableName() string

TableName ...

type UserConfigInfo added in v0.4.3

type UserConfigInfo struct {
	VersionKey    string `json:"versionKey"`    // 监控的版本key
	DashboardPath string `json:"dashboardPath"` // 监控维度
}

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"`

	// AccessToken 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 UserVisit added in v0.4.3

type UserVisit struct {
	Id       uint64 `gorm:"not null;primary_key;AUTO_INCREMENT" json:"id"`
	Uid      int    `gorm:"not null;index:idx_uid;comment:'用户id'" json:"uid"`
	Aid      int    `gorm:"not null;index:idx_aid;comment:'应用id'" json:"aid"`
	AppName  string `gorm:"not null;" json:"appName"`                      // 项目id
	ZoneCode string `gorm:"not null;index:idx_zone_code" json:"zone_code"` // 环境
	Env      string `gorm:"not null;index:idx_env" json:"env"`             // 环境
	Tab      string `gorm:"not null;" json:"tab"`
	TabName  string `gorm:"-" json:"tabName"`
	Url      string `gorm:"not null;" json:"url"` // url
	Ts       int64  `gorm:"not null;index:tx;" json:"ts"`
}

记录用户访问url信息表

func (UserVisit) TableName added in v0.4.3

func (UserVisit) 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 WorkerNode added in v0.4.0

type WorkerNode struct {
	ModelT

	HostName      string    `json:"host_name"`
	RegionCode    string    `json:"region_code"`
	RegionName    string    `json:"region_name"`
	ZoneCode      string    `json:"zone_code"`
	ZoneName      string    `json:"zone_name"`
	IP            string    `json:"ip"`
	Port          int       `json:"port"`
	Env           string    `json:"env"`
	LastHeartbeat time.Time `json:"last_heartbeat"`
}

func (WorkerNode) TableName added in v0.4.0

func (WorkerNode) TableName() string

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"`
}

Zone ...

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