model

package
v1.1.0-rc Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2021 License: AGPL-3.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 ApplicationPublishItemRelation

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

应用和发布项关联关系

func (ApplicationPublishItemRelation) TableName

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

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 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 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"`
	ManageConfig        string `gorm:"column:manage_config;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 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 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 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 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 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 设置模型对应数据库表名称

Jump to

Keyboard shortcuts

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