Documentation ¶
Overview ¶
Package dbclient 数据库相关操作
Index ¶
- type DBClient
- func (db *DBClient) Close() error
- func (client *DBClient) CreateRelease(release *Release) error
- func (client *DBClient) DeleteRelease(releaseID string) error
- func (client *DBClient) GetAppIDsByProjectAndVersion(projectID int64, version string) ([]int64, error)
- func (client *DBClient) GetLatestReleaseByAppAndVersion(appID int64, version string) (*Release, error)
- func (client *DBClient) GetRelease(releaseID string) (*Release, error)
- func (client *DBClient) GetReleaseNamesByApp(orgID, appID int64) ([]string, error)
- func (client *DBClient) GetReleases(releaseIDs []string) ([]Release, error)
- func (client *DBClient) GetReleasesByAppAndVersion(orgID, projectID, appID int64, version string) ([]Release, error)
- func (client *DBClient) GetReleasesByBranch(projectID, appID int64, gitBranch string) ([]Release, error)
- func (client *DBClient) GetReleasesByParams(orgID int64, req *apistructs.ReleaseListRequest) (int64, []Release, error)
- func (client *DBClient) GetReleasesByProjectAndVersion(orgID, projectID int64, version string) ([]Release, error)
- func (client *DBClient) GetUnReferedReleasesBefore(before time.Time) ([]Release, error)
- func (client *DBClient) UpdateRelease(release *Release) error
- type Release
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBClient ¶
func (*DBClient) CreateRelease ¶
CreateRelease 创建Release
func (*DBClient) DeleteRelease ¶
DeleteRelease 删除Release
func (*DBClient) GetAppIDsByProjectAndVersion ¶
func (client *DBClient) GetAppIDsByProjectAndVersion(projectID int64, version string) ([]int64, error)
GetAppIDsByProjectAndVersion 根据projectID & version 获取 appID 列表
func (*DBClient) GetLatestReleaseByAppAndVersion ¶
func (client *DBClient) GetLatestReleaseByAppAndVersion(appID int64, version string) (*Release, error)
GetLatestReleaseByAppAndVersion 获取应用下最新release
func (*DBClient) GetRelease ¶
GetRelease 获取Release
func (*DBClient) GetReleaseNamesByApp ¶
GetReleaseNamesByApp 根据 appID 获取 releaseName 列表
func (*DBClient) GetReleases ¶
GetReleases list releases by release ids
func (*DBClient) GetReleasesByAppAndVersion ¶
func (client *DBClient) GetReleasesByAppAndVersion(orgID, projectID, appID int64, version string) ([]Release, error)
GetReleasesByAppAndVersion 根据 appID & version获取 Release列表
func (*DBClient) GetReleasesByBranch ¶
func (*DBClient) GetReleasesByParams ¶
func (client *DBClient) GetReleasesByParams( orgID int64, req *apistructs.ReleaseListRequest) (int64, []Release, error)
GetReleasesByParams 根据参数过滤Release
func (*DBClient) GetReleasesByProjectAndVersion ¶
func (client *DBClient) GetReleasesByProjectAndVersion(orgID, projectID int64, version string) ([]Release, error)
GetReleasesByProjectAndVersion 根据 projectID & version获取 Release列表
func (*DBClient) GetUnReferedReleasesBefore ¶
GetUnReferedReleasesBefore 获取给定时间点前未引用的临时 Release
func (*DBClient) UpdateRelease ¶
UpdateRelease 更新Release
type Release ¶
type Release struct { // ReleaseID 唯一标识release, 创建时由服务端生成 ReleaseID string `json:"releaseId" gorm:"type:varchar(64);primary_key"` // ReleaseName 任意字符串,便于用户识别,最大长度255,必填 ReleaseName string `json:"releaseName" gorm:"index:idx_release_name;not null"` // Desc 详细描述此release功能, 选填 Desc string `json:"desc" gorm:"type:text"` // Dice 资源类型为diceyml时, 存储dice.yml内容, 选填 Dice string `json:"dice" gorm:"type:text"` // dice.yml // Addon 资源类型为addonyml时,存储addon.yml内容,选填 Addon string `json:"addon" gorm:"type:text"` // Changelog changelog,选填 Changelog string `json:"changelog" gorm:"type:text"` // IsStable stable表示非临时制品 IsStable bool `json:"isStable" gorm:"type:tinyint(1)"` // IsFormal 是否为正式版 IsFormal bool `json:"isFormal" gorm:"type:tinyint(1)"` // IsProjectRelease 是否为项目级别制品 IsProjectRelease bool `json:"IsProjectRelease" gorm:"type:tinyint(1)"` // Modes 项目级制品的部署模式 Modes string `json:"modes" gorm:"type:text"` // Labels 用于release分类,描述release类别,map类型, 最大长度1000, 选填 Labels string `json:"labels" gorm:"type:varchar(1000)"` // GitBranch 为分支名,自动从labels中解析,选填 GitBranch string `json:"gitBranch" gorm:"type:varchar(255)"` // Tags Tags string `json:"tags" gorm:"type:varchar(100)"` // Version 存储release版本信息, 同一企业同一项目同一应用下唯一,最大长度100,选填 Version string `json:"version" gorm:"type:varchar(100)"` // 版本,打标签的Release不可删除 // OrgID 企业标识符,描述release所属企业,选填 OrgID int64 `json:"orgId" gorm:"index:idx_org_id"` // 所属企业 // ProjectID 项目标识符,描述release所属项目,选填 ProjectID int64 `json:"projectId"` // ApplicationID 应用标识符,描述release所属应用,选填 ApplicationID int64 `json:"applicationId"` // ProjectName 项目名称,描述release所属项目,选填 ProjectName string `json:"projectName" gorm:"type:varchar(80)"` // ApplicationName 应用名称,描述release所属应用,选填 ApplicationName string `json:"applicationName" gorm:"type:varchar(80)"` // UserID 用户标识符, 描述release所属用户,最大长度50,选填 UserID string `json:"userId" gorm:"type:varchar(50)"` // ClusterName 集群名称,描述release所属集群,最大长度80,选填 ClusterName string `json:"clusterName" gorm:"type:varchar(80)"` // 所属集群 // Resources 指定release资源类型及资源存储路径, 为兼容现有diceyml,先选填 Resources string `json:"resources,omitempty" gorm:"type:text"` // Reference release被部署次数,当为0时,可清除 Reference int64 `json:"reference"` // 被部署次数,当为0时,表示可清除 // CrossCluster 表示当前 release 是否可以跨集群,无集群限制 CrossCluster bool `json:"crossCluster"` // CreatedAt release创建时间,创建时由服务端生成 CreatedAt time.Time `json:"createdAt"` // UpdatedAt release更新时间, 更新时由服务端更新 UpdatedAt time.Time `json:"updatedAt"` // IsLatest 是否为分支最新 IsLatest bool `json:"isLatest"` }
Click to show internal directories.
Click to hide internal directories.