model

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2021 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Activity

type Activity struct {
	BaseModel
	OrgID         int64
	ProjectID     int64
	ApplicationID int64
	BuildID       int64
	RuntimeID     int64
	UserID        string `gorm:"column:operator"`
	Type          string // 活动类型
	Action        string
	Desc          string // 活动描述
	Context       string `json:"context" gorm:"type:text"`
}

Activity 活动模型

func (Activity) TableName

func (Activity) TableName() string

TableName 设置模型对应数据库表名称

type AppCertificate

type AppCertificate struct {
	BaseModel
	AppID         int64
	CertificateID int64
	ApprovalID    int64
	Status        string
	Operator      string
	PushConfig    string
}

AppCertificate 应用引用证书信息模型

func (AppCertificate) TableName

func (AppCertificate) TableName() string

TableName 设置模型对应数据库表名称

type Application

type Application struct {
	BaseModel
	Name           string // 应用名称
	DisplayName    string // 应用展示名称
	Desc           string // 应用描述
	Config         string // 钉钉配置
	ProjectID      int64  `gorm:"index:idx_project_id"` // 应用关联项目Id
	ProjectName    string // 应用关联项目名称
	OrgID          int64  // 应用关联组织Id
	Mode           string // 应用模式
	Pined          bool   `gorm:"-"` // 应用是否pined
	GitRepo        string
	GitRepoAbbrev  string
	IsExternalRepo bool
	UnblockStart   *time.Time // 解封开始时间
	UnblockEnd     *time.Time // 解封结束时间
	RepoConfig     string
	UserID         string `gorm:"column:creator"` // 所属用户Id
	Extra          string // 应用配置namespace等
	IsPublic       bool   // 应用是否公开
}

Application 应用资源模型

func (Application) TableName

func (Application) TableName() string

TableName 设置模型对应数据库表名称

type ApplicationPublishItemRelation

type ApplicationPublishItemRelation struct {
	BaseModel
	AppID         int64
	PublishItemID int64
	Env           apistructs.DiceWorkspace
	Creator       string
	AK            string
	AI            string
}

应用和发布项关联关系

func (ApplicationPublishItemRelation) TableName

TableName 设置模型对应数据库表名称

type Approve

type Approve struct {
	BaseModel
	OrgID        uint64
	TargetID     uint64
	EntityID     uint64
	TargetName   string
	Extra        string
	Title        string
	Priority     string
	Status       string
	Submitter    string
	Approver     string
	Type         string // IOS发布证书/Android证书/消息推送证书
	Desc         string
	ApprovalTime *time.Time
}

Approve 审批信息模型

func (Approve) TableName

func (Approve) TableName() string

TableName 设置模型对应数据库表名称

type Audit

type Audit struct {
	BaseModel
	StartTime    time.Time               `gorm:"column:start_time"`
	EndTime      time.Time               `gorm:"column:end_time"`
	UserID       string                  `gorm:"column:user_id"`
	ScopeType    apistructs.ScopeType    `gorm:"column:scope_type"`
	ScopeID      uint64                  `gorm:"column:scope_id"`
	FDPProjectID string                  `gorm:"column:fdp_project_id"`
	AppID        uint64                  `gorm:"column:app_id"`
	ProjectID    uint64                  `gorm:"column:project_id"`
	OrgID        uint64                  `gorm:"column:org_id"`
	Context      string                  `gorm:"column:context"`
	TemplateName apistructs.TemplateName `gorm:"column:template_name"`
	AuditLevel   string                  `gorm:"column:audit_level"`
	Result       apistructs.Result       `gorm:"column:result"`
	ErrorMsg     string                  `gorm:"column:error_msg"`
	ClientIP     string                  `gorm:"column:client_ip"`
	UserAgent    string                  `gorm:"column:user_agent"`
	Deleted      int                     `gorm:"column:deleted"`
}

Audit 审计事件

func (Audit) TableName

func (Audit) TableName() string

TableName 设置模型对应数据库表名称

type AuditSettings

type AuditSettings struct {
	ID     uint64
	Config OrgConfig
}

AuditSettings 审计事件的清理周期设置

type BaseModel

type BaseModel struct {
	ID        int64     `json:"id" gorm:"primary_key"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

BaseModel common info for all models

type BlockoutConfig

type BlockoutConfig struct {
	BlockDEV   bool `json:"blockDev"`
	BlockTEST  bool `json:"blockTest"`
	BlockStage bool `json:"blockStage"`
	BlockProd  bool `json:"blockProd"`
}

func (*BlockoutConfig) Scan

func (cfg *BlockoutConfig) Scan(value interface{}) error

func (BlockoutConfig) Value

func (cfg BlockoutConfig) Value() (driver.Value, error)

type BranchRule

type BranchRule struct {
	BaseModel
	ScopeType         apistructs.ScopeType
	ScopeID           int64
	Rule              string
	IsProtect         bool
	IsTriggerPipeline bool
	NeedApproval      bool
	Desc              string //规则说明
	Workspace         string `json:"workspace"`
	ArtifactWorkspace string `json:"artifactWorkspace"`
}

func (BranchRule) TableName

func (BranchRule) TableName() string

TableName 设置模型对应数据库表名称

func (*BranchRule) ToApiData

func (rule *BranchRule) ToApiData() *apistructs.BranchRule

type Certificate

type Certificate struct {
	BaseModel
	OrgID    int64
	Name     string
	Android  string
	Ios      string
	Message  string
	Type     string // IOS发布证书/Android证书/消息推送证书
	Desc     string
	Creator  string
	Operator string
}

Certificate 证书信息模型

func (Certificate) TableName

func (Certificate) TableName() string

TableName 设置模型对应数据库表名称

type CloudAccount

type CloudAccount struct {
	BaseModel
	CloudProvider   string // 云厂商
	Name            string // 账号名
	AccessKeyID     string // KeyID, 不明文展示
	AccessKeySecret string // KeySecret, 不明文展示
	OrgID           int64  // 应用关联组织Id
}

CloudAccount 云账号模型

func (CloudAccount) TableName

func (CloudAccount) TableName() string

type Cluster

type Cluster struct {
	BaseModel
	OrgID               int64
	Name                string
	DisplayName         string
	CloudVendor         string
	Description         string
	Type                string
	WildcardDomain      string
	URLs                string `gorm:"type:text"`
	Settings            string `gorm:"type:text"`
	Config              string `gorm:"type:text"` // TODO 废弃 urls & settings 字段,统一存储于 config
	SchedulerConfig     string `gorm:"column:scheduler;type:text"`
	OpsConfig           string `gorm:"column:opsconfig;type:text"`
	CloudResourceConfig string `gorm:"column:resource;type:text"`
	SysConfig           string `gorm:"column:sys;type:text"`
}

Cluster 集群数据模型

func (Cluster) TableName

func (Cluster) TableName() string

TableName 设置模型对应数据库表名称

type ClusterEdgeSiteRelation

type ClusterEdgeSiteRelation struct {
	BaseModel
	ClusterID  int64 `gorm:"unique_index:idx_cluster_edgesite_id"`
	EdgeSiteID int64 `gorm:"unique_index:idx_cluster_edgesite_id"`
}

ClusterEdgeSiteRelation 集群边缘站点关联关系

func (ClusterEdgeSiteRelation) TableName

func (ClusterEdgeSiteRelation) TableName() string

TableName 设置模型对应数据库表名称

type Comment

type Comment struct {
	BaseModel
	TicketID    int64
	CommentType apistructs.TCType
	Content     string               `gorm:"type:text"`
	IRComment   apistructs.IRComment `json:"irComment" gorm:"column:ir_comment;type:text"`
	UserID      string
}

Comment 工单评论模型

func (Comment) TableName

func (Comment) TableName() string

TableName 设置模型对应数据库表名称

type ConfigItem

type ConfigItem struct {
	ID           int64     `json:"id" gorm:"primary_key"`
	CreatedAt    time.Time `json:"createdAt" gorm:"column:create_time"`
	UpdatedAt    time.Time `json:"updatedAt" gorm:"column:update_time"`
	IsSync       bool      // deprecated
	Dynamic      bool      // deprecated
	Encrypt      bool      // deprecated
	DeleteRemote bool      // deprecated
	IsDeleted    string
	NamespaceID  uint64 `gorm:"index:namespace_id"`
	ItemKey      string
	ItemValue    string
	ItemComment  string
	ItemType     string // FILE, ENV
	Source       string
	Status       string // deprecated
}

ConfigItem 配置信息

func (ConfigItem) TableName

func (ConfigItem) TableName() string

TableName 设置模型对应数据库表名称

type ConfigNamespace

type ConfigNamespace struct {
	ID            int64     `json:"id" gorm:"primary_key"`
	CreatedAt     time.Time `json:"createdAt" gorm:"column:create_time"`
	UpdatedAt     time.Time `json:"updatedAt" gorm:"column:update_time"`
	Dynamic       bool
	IsDefault     bool
	IsDeleted     string
	Name          string
	Env           string `gorm:"index:env"`
	ProjectID     string `gorm:"index:project_id"`
	ApplicationID string `gorm:"index:application_id"`
	RuntimeID     string `gorm:"index:runtime_id"`
}

ConfigNamespace 配置信息

func (ConfigNamespace) TableName

func (ConfigNamespace) TableName() string

TableName 设置模型对应数据库表名称

type ConfigNamespaceRelation

type ConfigNamespaceRelation struct {
	ID               int64     `json:"id" gorm:"primary_key"`
	CreatedAt        time.Time `json:"createdAt" gorm:"column:create_time"`
	UpdatedAt        time.Time `json:"updatedAt" gorm:"column:update_time"`
	IsDeleted        string
	Namespace        string `gorm:"index:namespace"`
	DefaultNamespace string `gorm:"index:default_namespace"`
}

ConfigNamespaceRelation 配置信息

func (ConfigNamespaceRelation) TableName

func (ConfigNamespaceRelation) TableName() string

TableName 设置模型对应数据库表名称

type Container

type Container struct {
	BaseModel
	ContainerID         string  `json:"id" gorm:"column:container_id;type:varchar(64);index:container_id"` // 容器ID
	Deleted             bool    `json:"deleted"`                                                           // 资源是否被删除
	StartedAt           string  `json:"started_at"`                                                        // 容器启动时间
	FinishedAt          string  `json:"finished_at"`                                                       // 容器结束时间
	ExitCode            int     `json:"exit_code"`                                                         // 容器退出码
	Privileged          bool    `json:"privileged"`                                                        // 是否是特权容器
	Cluster             string  `json:"cluster_full_name"`                                                 // 集群名
	HostPrivateIPAddr   string  `json:"host_private_addr"`                                                 // 宿主机内网地址
	IPAddress           string  `json:"ip_addr"`                                                           // 容器IP地址
	Image               string  `json:"image_name"`                                                        // 容器镜像名
	CPU                 float64 `json:"cpu"`                                                               // 分配的cpu
	Memory              int64   `json:"memory"`                                                            // 分配的内存(字节)
	Disk                int64   `json:"disk"`                                                              // 分配的磁盘空间(字节)
	DiceOrg             string  `json:"dice_org"`                                                          // 所在的组织
	DiceProject         string  `gorm:"type:varchar(40);index:idx_project_id"`                             // 所在大项目
	DiceApplication     string  `json:"dice_application"`                                                  // 所在项目
	DiceRuntime         string  `gorm:"type:varchar(40);index:idx_runtime_id"`                             // 所在runtime
	DiceService         string  `json:"dice_service"`                                                      // 对应 service
	EdasAppID           string  `gorm:"type:varchar(64);index:idx_edas_app_id"`                            // EDAS 应用 ID,与 dice service 属于一个层级
	EdasAppName         string  `gorm:"type:varchar(128)"`
	EdasGroupID         string  `gorm:"type:varchar(64)"`
	DiceProjectName     string  `json:"dice_project_name"`               // 所在大项目名称
	DiceApplicationName string  `json:"dice_application_name"`           // 所在项目
	DiceRuntimeName     string  `json:"dice_runtime_name"`               // 所在runtime
	DiceComponent       string  `json:"dice_component"`                  // 组件名
	DiceAddon           string  `json:"dice_addon"`                      // 中间件id
	DiceAddonName       string  `json:"dice_addon_name"`                 // 中间件名称
	DiceWorkspace       string  `json:"dice_workspace"`                  // 部署环境
	DiceSharedLevel     string  `json:"dice_shared_level"`               // 中间件共享级别
	Status              string  `json:"status"`                          // 前期定义为docker状态(后期期望能表示服务状态)
	TimeStamp           int64   `json:"timestamp"`                       // 消息本身的时间戳
	TaskID              string  `gorm:"type:varchar(180);index:task_id"` // task id
	Env                 string  `json:"env,omitempty" gorm:"-"`          // 该容器由哪个环境发布(dev, test, staging, prod)
}

Container 容器实例元数据

func (Container) TableName

func (Container) TableName() string

TableName 设置模型对应数据库表名称

type CurrentOrg

type CurrentOrg struct {
	BaseModel
	UserID string
	OrgID  int64
}

CurrentOrg 用户当前所属企业

func (CurrentOrg) TableName

func (CurrentOrg) TableName() string

TableName 设置模型对应数据库表名称

type Deployments

type Deployments struct {
	ID              int64     `json:"id" gorm:"primary_key"`
	CreatedAt       time.Time `json:"createdAt"`
	UpdatedAt       time.Time `json:"updatedAt"`
	OrgID           uint64    `gorm:"index:org_id"`
	ProjectID       uint64
	ApplicationID   uint64
	PipelineID      uint64
	TaskID          uint64
	QueueTimeSec    int64 // 排队耗时
	CostTimeSec     int64 // 任务耗时
	ProjectName     string
	ApplicationName string
	TaskName        string
	Status          string
	Env             string
	ClusterName     string
	UserID          string
	RuntimeID       string
	ReleaseID       string
	Extra           ExtraDeployment `json:"extra"`
}

Deployments 部署的服务信息

func (Deployments) TableName

func (Deployments) TableName() string

TableName 设置模型对应数据库表名称

type ErrorLog

type ErrorLog struct {
	BaseModel
	ResourceType   apistructs.ErrorResourceType `gorm:"column:resource_type"`
	ResourceID     string                       `gorm:"column:resource_id"`
	Level          apistructs.ErrorLogLevel     `gorm:"column:level"`
	OccurrenceTime time.Time                    `gorm:"column:occurrence_time"`
	HumanLog       string                       `gorm:"column:human_log"`
	PrimevalLog    string                       `gorm:"column:primeval_log"`
	DedupID        string                       `gorm:"column:dedup_id"`
}

ErrorLog 错误日志模型

func (ErrorLog) TableName

func (ErrorLog) TableName() string

TableName 设置模型对应数据库表名称

type ExtraDeployment

type ExtraDeployment struct{}

额外字段预留

type ExtraJob

type ExtraJob struct{}

额外字段预留

type FavoritedResource

type FavoritedResource struct {
	BaseModel
	Target   string // 被收藏的资源类型: app/project, etc
	TargetID uint64
	UserID   string
}

FavoritedResource 收藏的资源

type Host

type Host struct {
	BaseModel
	Name          string  `json:"hostname"`                                                 // 主机名
	OrgName       string  `gorm:"type:varchar(100);index:org_name"`                         // 企业名称
	Cluster       string  `json:"cluster_full_name" gorm:"type:varchar(100);index:cluster"` // 集群名字
	PrivateAddr   string  `json:"private_addr"`                                             // 内网地址
	Cpus          float64 `json:"cpus"`                                                     // 总CPU个数
	CpuUsage      float64 `json:"cpuUsage"`                                                 // CPU使用核数
	Memory        int64   `json:"memory"`                                                   // 总内存数(字节)
	MemoryUsage   int64   `json:"memoryUsage"`                                              // 内存使用(字节)
	Disk          int64   `json:"disk"`                                                     // 磁盘大小(字节)
	DiskUsage     int64   `json:"diskUsage"`                                                // 磁盘使用(字节)
	Load5         float64 `json:"load5"`                                                    // 负载值
	Labels        string  `json:"labels"`                                                   // 环境标签
	OS            string  `json:"os"`                                                       // 操作系统类型
	KernelVersion string  `json:"kernel_version"`                                           // 内核版本
	SystemTime    string  `json:"system_time"`                                              // 系统时间
	Birthday      int64   `json:"created_at"`                                               // 创建时间(operator定义)
	TimeStamp     int64   `json:"timestamp"`                                                // 消息本身的时间戳
	Deleted       bool    `json:"deleted"`                                                  // 资源是否被删除
}

Host 主机元数据

func (Host) TableName

func (Host) TableName() string

TableName 设置模型对应数据库表名称

type Jobs

type Jobs struct {
	ID              int64     `json:"id" gorm:"primary_key"`
	CreatedAt       time.Time `json:"createdAt"`
	UpdatedAt       time.Time `json:"updatedAt"`
	OrgID           uint64    `gorm:"index:org_id"`
	ProjectID       uint64
	ApplicationID   uint64
	PipelineID      uint64
	TaskID          uint64
	QueueTimeSec    int64 // 排队耗时
	CostTimeSec     int64 // 任务耗时
	ProjectName     string
	ApplicationName string
	TaskName        string
	Status          string
	Env             string
	ClusterName     string
	TaskType        string
	UserID          string
	Extra           ExtraJob `json:"extra"`
}

Jobs 运行的job信息

func (Jobs) TableName

func (Jobs) TableName() string

TableName 设置模型对应数据库表名称

type MBox

type MBox struct {
	BaseModel
	Title   string
	Content string
	Label   string //站内信所属模块  monitor|pipeline
	UserID  string
	Status  apistructs.MBoxStatus //read|unread
	OrgID   int64
	ReadAt  *time.Time
}

func (MBox) TableName

func (MBox) TableName() string

func (MBox) ToApiData

func (mbox MBox) ToApiData() *apistructs.MBox

type ManualReview

type ManualReview struct {
	BaseModel
	BuildId         int    `gorm:"build_id"`
	ProjectId       int    `gorm:"project_id"`
	ApplicationId   int    `gorm:"application_id"`
	ApplicationName string `gorm:"application_name"`
	SponsorId       string `gorm:"sponsor_id"`
	CommitID        string `gorm:"commit_id"`
	OrgId           int64  `gorm:"org_id"`
	TaskId          int    `gorm:"task_id"`
	ProjectName     string `gorm:"project_name"`
	BranchName      string `gorm:"branch_name"`
	ApprovalStatus  string `gorm:"approval_status"`
	CommitMessage   string `gorm:"commit_message"`
	ApprovalReason  string `gorm:"approval_reason"`
}

type Member

type Member struct {
	BaseModel
	ScopeType     apistructs.ScopeType // 系统管理员(sys)/企业(org)/项目(project)/应用(app)
	ScopeID       int64                // 企业ID/项目ID/应用ID
	ScopeName     string               // 企业/项目/应用名称
	ParentID      int64
	UserID        string
	Email         string    // 用户邮箱
	Mobile        string    // 用户手机号
	Name          string    // 用户名
	Nick          string    // 用户昵称
	Avatar        string    // 用户头像
	Token         string    // 用户鉴权token
	UserSyncAt    time.Time // 用户信息同步时间
	OrgID         int64     // 冗余 OrgID,方便用于退出企业时删除所有企业相关 member
	ProjectID     int64     // 冗余 ProjectID,方便用户退出项目时删除所有项目相关 member
	ApplicationID int64     // 冗余 AppID,目前等价于 scopeType=app & scopeID=appID
	Roles         []string  `gorm:"-"` // Manager/Developer/Tester
	Labels        []string  `gorm:"-"` // 不是表字段,用来记录join表后返回的标签字段。
	Deleted       bool      `gorm:"-"` // 不是表字段,用来过滤uc已删除的用户
}

Member 企业/项目/应用三级关系成员信息(包含平台管理员)

func (*Member) Convert2APIDTO

func (m *Member) Convert2APIDTO() apistructs.Member

func (Member) TableName

func (Member) TableName() string

TableName 设置模型对应数据库表名称

type MemberExtra

type MemberExtra struct {
	BaseModel
	// UeserID 关联成员的用户id
	UserID string `gorm:"column:user_id"`
	// ParentID 成员的父scope_id
	ParentID int64 `gorm:"column:parent_id"`
	// ScopeType 关联成员的scope_type
	ScopeType apistructs.ScopeType `gorm:"column:scope_type"`
	// ScopeID 关联成员的scope_id
	ScopeID int64 `gorm:"column:scope_id"`
	// ResourceKey 关联资源的key
	ResourceKey apistructs.ExtraResourceKey `gorm:"column:resource_key"`
	// ResourceValue 管理资源的值
	ResourceValue string `gorm:"column:resource_value"`
}

func (MemberExtra) TableName

func (MemberExtra) TableName() string

TableName 表名

type MemberJoin

type MemberJoin struct {
	Member
	ResourceKey   apistructs.ExtraResourceKey `gorm:"column:resource_key"`
	ResourceValue string                      `gorm:"column:resource_value"`
}

MemberJoin 用于和 memberExtra 连表查询获取member额外的信息

type Notify

type Notify struct {
	BaseModel
	Name          string `gorm:"size:150"`
	ScopeType     string `gorm:"size:150;index:idx_scope_type"`
	ScopeID       string `gorm:"size:150;index:idx_scope_id"`
	Label         string `gorm:"size:150"`
	ClusterName   string
	Channels      string `gorm:"type:text"`
	NotifyGroupID int64  `gorm:"index:notify_group_id"`
	OrgID         int64  `gorm:"index:idx_org_id"`
	Creator       string
	Enabled       bool
	Data          string `gorm:"type:text"`
}

func (Notify) TableName

func (Notify) TableName() string

TableName 设置模型对应数据库表名称

type NotifyGroup

type NotifyGroup struct {
	BaseModel
	Name        string `gorm:"size:150"`
	ScopeType   string `gorm:"size:150;index:idx_scope_type"`
	ScopeID     string `gorm:"size:150;index:idx_scope_id"`
	OrgID       int64  `gorm:"index:idx_org_id"`
	TargetData  string `gorm:"type:text"`
	Label       string `gorm:"size:200"`
	ClusterName string
	AutoCreate  bool
	Creator     string `gorm:"size:150"`
}

func (NotifyGroup) TableName

func (NotifyGroup) TableName() string

func (*NotifyGroup) ToApiData

func (notifyGroup *NotifyGroup) ToApiData() *apistructs.NotifyGroup

type NotifyHistory

type NotifyHistory struct {
	BaseModel
	NotifyName            string `gorm:"size:150;index:idx_notify_name"`
	NotifyItemDisplayName string `gorm:"size:150"`
	Channel               string `gorm:"size:150"`
	TargetData            string `gorm:"type:text"`
	SourceData            string `gorm:"type:text"`
	Status                string `gorm:"size:150"`
	OrgID                 int64  `gorm:"index:idx_org_id"`
	SourceType            string `gorm:"size:150"`
	SourceID              string `gorm:"size:150"`
	ErrorMsg              string `gorm:"type:text"`
	// 模块类型 cdp/workbench/monitor
	Label       string `gorm:"size:150;index:idx_module"`
	ClusterName string
}

func (NotifyHistory) TableName

func (NotifyHistory) TableName() string

TableName 设置模型对应数据库表名称

func (*NotifyHistory) ToApiData

func (notifyHistory *NotifyHistory) ToApiData() *apistructs.NotifyHistory

type NotifyItem

type NotifyItem struct {
	BaseModel
	Name             string `gorm:"size:150"`
	DisplayName      string `gorm:"size:150"`
	Category         string `gorm:"size:150"`
	MobileTemplate   string `gorm:"type:text"`
	EmailTemplate    string `gorm:"type:text"`
	DingdingTemplate string `gorm:"type:text"`
	MBoxTemplate     string `gorm:"type:text;column:mbox_template"`
	// 语音通知模版
	VMSTemplate string `gorm:"type:text;column:vms_template"`
	// 语音通知的被叫显号,语音模版属于公共号码池外呼的时候,被叫显号必须是空
	// 属于专属号码外呼的时候,被叫显号不能为空
	CalledShowNumber string `gorm:"size:150;column:called_show_number"`
	ScopeType        string `gorm:"size:150"`
	Label            string `gorm:"size:150"`
	Params           string `gorm:"type:text"`
}

func (NotifyItem) TableName

func (NotifyItem) TableName() string

func (*NotifyItem) ToApiData

func (notifyItem *NotifyItem) ToApiData() *apistructs.NotifyItem

type NotifyItemRelation

type NotifyItemRelation struct {
	BaseModel
	NotifyID     int64 `gorm:"index:notify_id"`
	NotifyItemID int64 `gorm:"index:notify_item_id"`
}

func (NotifyItemRelation) TableName

func (NotifyItemRelation) TableName() string

TableName 设置模型对应数据库表名称

type NotifySource

type NotifySource struct {
	BaseModel
	Name       string `gorm:"size:150"`
	NotifyID   int64  `gorm:"index:notify_id"`
	SourceType string `gorm:"index:source_type"`
	SourceID   string `gorm:"index:source_id"`
	OrgID      int64
}

func (NotifySource) TableName

func (NotifySource) TableName() string

TableName 设置模型对应数据库表名称

type Org

type Org struct {
	BaseModel
	Name           string
	DisplayName    string
	Desc           string
	Locale         string
	OpenFdp        bool   `json:"openFdp"`
	UserID         string `gorm:"column:creator"` // 所属用户Id
	Config         OrgConfig
	BlockoutConfig BlockoutConfig
	Type           string
	Status         string // TODO deprecated 待admin下线后删除
	IsPublic       bool
}

Org 企业资源模型

func (Org) TableName

func (Org) TableName() string

TableName 设置模型对应数据库表名称

type OrgClusterRelation

type OrgClusterRelation struct {
	BaseModel
	OrgID       uint64 `gorm:"unique_index:idx_org_cluster_id"`
	OrgName     string
	ClusterID   uint64 `gorm:"unique_index:idx_org_cluster_id"`
	ClusterName string
	Creator     string
}

OrgClusterRelation 企业集群关联关系

func (OrgClusterRelation) TableName

func (OrgClusterRelation) TableName() string

TableName 设置模型对应数据库表名称

type OrgConfig

type OrgConfig struct {
	EnableMS                   bool   `json:"enableMs"`
	SMTPHost                   string `json:"smtpHost"`
	SMTPUser                   string `json:"smtpUser"`
	SMTPPassword               string `json:"smtpPassword"`
	SMTPPort                   int64  `json:"smtpPort"`
	SMTPIsSSL                  bool   `json:"smtpIsSSL"`
	SMSKeyID                   string `json:"smsKeyID"`
	SMSKeySecret               string `json:"smsKeySecret"`
	SMSSignName                string `json:"smsSignName"`
	SMSMonitorTemplateCode     string `json:"smsMonitorTemplateCode"` // 监控单独的短信模版
	VMSKeyID                   string `json:"vmsKeyID"`
	VMSKeySecret               string `json:"vmsKeySecret"`
	VMSMonitorTtsCode          string `json:"vmsMonitorTtsCode"`          // 监控单独的语音模版
	VMSMonitorCalledShowNumber string `json:"vmsMonitorCalledShowNumber"` // 监控单独的被叫显号
	AuditInterval              int64  `json:"auditInterval"`

	// 开关:制品是否可以跨集群部署
	EnableReleaseCrossCluster bool `json:"enableReleaseCrossCluster"`
}

func (*OrgConfig) Scan

func (cfg *OrgConfig) Scan(value interface{}) error

func (OrgConfig) Value

func (cfg OrgConfig) Value() (driver.Value, error)

type Project

type Project struct {
	BaseModel
	Name           string // 项目名称
	DisplayName    string // 项目展示名称
	Desc           string // 项目描述
	OrgID          int64  // 项目关联组织ID
	UserID         string `gorm:"column:creator"` // 所属用户Id
	DDHook         string `gorm:"column:dd_hook"` // 钉钉Hook
	ClusterConfig  string // 集群配置 eg: {"DEV":"terminus-y","TEST":"terminus-y","STAGING":"terminus-y","PROD":"terminus-y"}
	RollbackConfig string // 回滚配置: {"DEV": 1,"TEST": 2,"STAGING": 3,"PROD": 4}
	CpuQuota       float64
	MemQuota       float64
	Functions      string    `gorm:"column:functions"`
	ActiveTime     time.Time `gorm:"column:active_time"`
	EnableNS       bool      `gorm:"column:enable_ns"` // 是否打开项目级命名空间
	IsPublic       bool      `gorm:"column:is_public"` // 是否是公开项目
}

Project 项目资源模型

func (Project) TableName

func (Project) TableName() string

TableName 设置模型对应数据库表名称

type Publisher

type Publisher struct {
	BaseModel
	Name          string // Publisher名称
	PublisherType string // Publisher类型
	PublisherKey  string // PublisherKey,可以作为唯一标示,主要用于监控
	Desc          string // Publisher描述
	OrgID         int64  // Publisher关联组织ID
	UserID        string `gorm:"column:creator"` // 所属用户Id
}

Publisher 资源模型

func (Publisher) TableName

func (Publisher) TableName() string

TableName 设置模型对应数据库表名称

type ReviewUser

type ReviewUser struct {
	BaseModel
	Operator string `gorm:"operator"`
	OrgId    int64  `gorm:"org_id"`
	TaskId   int64  `gorm:"task_id"`
}

type RolePermission

type RolePermission struct {
	dbengine.BaseModel
	Scope        string `gorm:"type:varchar(30);unique_index:idx_resource_action" yaml:"scope"`
	Role         string `gorm:"type:varchar(30);unique_index:idx_resource_action" yaml:"role"`
	ResourceRole string `gorm:"type:varchar(30);unique_index:idx_resource_action" yaml:"resource_role"`
	Resource     string `gorm:"type:varchar(40);unique_index:idx_resource_action" yaml:"resource"`
	Action       string `gorm:"type:varchar(30);unique_index:idx_resource_action" yaml:"action"`
	Creator      string
}

RolePermission 角色资源操作

func (RolePermission) TableName

func (RolePermission) TableName() string

type Ticket

type Ticket struct {
	BaseModel
	Title        string
	Content      string                `json:"content" gorm:"type:text"`
	Type         apistructs.TicketType `gorm:"type:varchar(20);index:idx_type"`
	Priority     apistructs.TicketPriority
	Status       apistructs.TicketStatus
	RequestID    string `gorm:"type:varchar(60);index:idx_request_id"`
	Key          string `gorm:"type:varchar(64);index:idx_key"` // 告警使用,作为唯一 key
	OrgID        string
	Metric       string
	MetricID     string
	Count        int64 // 相同类型工单聚合
	Creator      string
	LastOperator string
	Label        string                  `json:"label" gorm:"type:text"`
	TargetType   apistructs.TicketTarget `gorm:"type:varchar(40);index:idx_target_type"`
	TargetID     string
	TriggeredAt  time.Time // 发生时间
	ClosedAt     time.Time
}

Ticket 工单数据结构

func (Ticket) TableName

func (Ticket) TableName() string

TableName 设置模型对应数据库表名称

Jump to

Keyboard shortcuts

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