Documentation ¶
Index ¶
- func InitMysqlMock() (*gorm.DB, sqlmock.Sqlmock, error)
- type Common
- type LabelRelation
- type LabelRelationConfigDB
- func (client *LabelRelationConfigDB) BatchQueryReleaseTagIDMap(releaseIDs []string) (map[string][]uint64, error)
- func (client *LabelRelationConfigDB) CreateLabelRelation(lr *LabelRelation) error
- func (client *LabelRelationConfigDB) DeleteLabelRelations(refType apistructs.ProjectLabelType, refID string) error
- func (client *LabelRelationConfigDB) DeleteLabelRelationsByLabel(labelID uint64) error
- func (client *LabelRelationConfigDB) GetLabelRelationsByLabels(refType apistructs.ProjectLabelType, labelIDs []uint64) ([]LabelRelation, error)
- func (client *LabelRelationConfigDB) GetLabelRelationsByRef(refType apistructs.ProjectLabelType, refID string) ([]LabelRelation, error)
- type Model
- type OpusDB
- type Release
- type ReleaseConfigDB
- func (client *ReleaseConfigDB) CreateRelease(release *Release) error
- func (client *ReleaseConfigDB) DeleteRelease(releaseID string) error
- func (client *ReleaseConfigDB) GetAppIDsByProjectAndVersion(projectID int64, version string) ([]int64, error)
- func (client *ReleaseConfigDB) GetLatestReleaseByAppAndVersion(appID int64, version string) (*Release, error)
- func (client *ReleaseConfigDB) GetRelease(releaseID string) (*Release, error)
- func (client *ReleaseConfigDB) GetReleaseNamesByApp(orgID, appID int64) ([]string, error)
- func (client *ReleaseConfigDB) GetReleases(releaseIDs []string) ([]Release, error)
- func (client *ReleaseConfigDB) GetReleasesByAppAndVersion(orgID, projectID, appID int64, version string) ([]Release, error)
- func (client *ReleaseConfigDB) GetReleasesByBranch(projectID, appID int64, gitBranch string) ([]Release, error)
- func (client *ReleaseConfigDB) GetReleasesByParams(orgID int64, req *pb.ReleaseListRequest) (int64, []Release, error)
- func (client *ReleaseConfigDB) GetReleasesByProjectAndVersion(orgID, projectID int64, version string) ([]Release, error)
- func (client *ReleaseConfigDB) GetUnReferedReleasesBefore(before time.Time) ([]Release, error)
- func (client *ReleaseConfigDB) UpdateRelease(release *Release) error
- type ReleaseOpus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitMysqlMock ¶
Types ¶
type LabelRelation ¶
type LabelRelation struct { dbengine.BaseModel LabelID uint64 `json:"label_id"` // 标签 id RefType apistructs.ProjectLabelType `json:"ref_type"` // 标签作用类型, eg: issue RefID string `json:"ref_id"` // 标签关联目标 id }
LabelRelation 标签关联关系
type LabelRelationConfigDB ¶
func (*LabelRelationConfigDB) BatchQueryReleaseTagIDMap ¶
func (client *LabelRelationConfigDB) BatchQueryReleaseTagIDMap(releaseIDs []string) (map[string][]uint64, error)
BatchQueryReleaseTagIDMap 批量查询 release label id
func (*LabelRelationConfigDB) CreateLabelRelation ¶
func (client *LabelRelationConfigDB) CreateLabelRelation(lr *LabelRelation) error
CreateLabelRelation 创建标签关联关系
func (*LabelRelationConfigDB) DeleteLabelRelations ¶
func (client *LabelRelationConfigDB) DeleteLabelRelations(refType apistructs.ProjectLabelType, refID string) error
DeleteLabelRelations 删除标签关联关系
func (*LabelRelationConfigDB) DeleteLabelRelationsByLabel ¶
func (client *LabelRelationConfigDB) DeleteLabelRelationsByLabel(labelID uint64) error
DeleteLabelRelationsByLabel 根据 labelID 删除标签
func (*LabelRelationConfigDB) GetLabelRelationsByLabels ¶
func (client *LabelRelationConfigDB) GetLabelRelationsByLabels(refType apistructs.ProjectLabelType, labelIDs []uint64) ([]LabelRelation, error)
GetLabelRelationsByLabels 获取标签关联关系列表
func (*LabelRelationConfigDB) GetLabelRelationsByRef ¶
func (client *LabelRelationConfigDB) GetLabelRelationsByRef(refType apistructs.ProjectLabelType, refID string) ([]LabelRelation, error)
GetLabelRelationsByRef 获取标签关联关系列表
type OpusDB ¶
func (OpusDB) CreateOpus ¶
func (o OpusDB) CreateOpus(opus *ReleaseOpus) error
func (OpusDB) DeleteOpusByReleaseID ¶
func (OpusDB) QueryReleaseOpus ¶
type Release ¶
type Release struct { // ReleaseID Generated by the server when created ReleaseID string `json:"releaseId" gorm:"type:varchar(64);primary_key"` // ReleaseName Any string, easy for users to identify, the maximum length is 255, required ReleaseName string `json:"releaseName" gorm:"index:idx_release_name;not null"` // Desc Describe, optional Desc string `json:"desc" gorm:"type:text"` // Dice When ResourceType is diceyml, store dice.yml context, optional Dice string `json:"dice" gorm:"type:text"` // dice.yml // Addon When ResourceType is addonyml,store addon.yml context,optional Addon string `json:"addon" gorm:"type:text"` // Changelog changelog,optional Changelog string `json:"changelog" gorm:"type:text"` // IsStable not temp if ture, otherwise temp IsStable bool `json:"isStable" gorm:"type:tinyint(1)"` // IsFormal formal IsFormal bool `json:"isFormal" gorm:"type:tinyint(1)"` // IsProjectRelease . IsProjectRelease bool `json:"IsProjectRelease" gorm:"type:tinyint(1)"` // Modes list of release deployment mode Modes string `json:"modes" gorm:"type:text"` // Labels map type, the maximum length is 1000, optional Labels string `json:"labels" gorm:"type:varchar(1000)"` // GitBranch GitBranch string `json:"gitBranch" gorm:"type:varchar(255)"` // Version store release version, only in the same company, same project and same application,the maximum length is 100,optional Version string `json:"version" gorm:"type:varchar(100)"` // OrgID Corporate identifier,optional OrgID int64 `json:"orgId" gorm:"index:idx_org_id"` // ProjectID Project identifier,optional ProjectID int64 `json:"projectId"` // ApplicationID Application identifier,optional ApplicationID int64 `json:"applicationId"` // ProjectName Project name,optional ProjectName string `json:"projectName" gorm:"type:varchar(80)"` // ApplicationName Application name,optional ApplicationName string `json:"applicationName" gorm:"type:varchar(80)"` // UserID User identifier,the maximum length is 50,optional UserID string `json:"userId" gorm:"type:varchar(50)"` // ClusterName Cluster Name,the maximum length is 80,optional ClusterName string `json:"clusterName" gorm:"type:varchar(80)"` // 所属集群 // Resources Specify the release resource type and resource storage path, optional Resources string `json:"resources,omitempty" gorm:"type:text"` // Reference Number of deployments, when it is 0, can be clear Reference int64 `json:"reference"` // CrossCluster Indicates whether the current release can cross clusters, without cluster restrictions CrossCluster bool `json:"crossCluster"` // CreatedAt Release created time CreatedAt time.Time `json:"createdAt"` // UpdatedAt Release updated time UpdatedAt time.Time `json:"updatedAt"` // IsLatest 是否为分支最新 IsLatest bool `json:"isLatest"` }
type ReleaseConfigDB ¶
ReleaseConfig .
func (*ReleaseConfigDB) CreateRelease ¶
func (client *ReleaseConfigDB) CreateRelease(release *Release) error
CreateRelease Create Release
func (*ReleaseConfigDB) DeleteRelease ¶
func (client *ReleaseConfigDB) DeleteRelease(releaseID string) error
DeleteRelease Delete Release
func (*ReleaseConfigDB) GetAppIDsByProjectAndVersion ¶
func (client *ReleaseConfigDB) GetAppIDsByProjectAndVersion(projectID int64, version string) ([]int64, error)
GetAppIDsByProjectAndVersion Get appIDList by projectID & version
func (*ReleaseConfigDB) GetLatestReleaseByAppAndVersion ¶
func (client *ReleaseConfigDB) GetLatestReleaseByAppAndVersion(appID int64, version string) (*Release, error)
GetLatestReleaseByAppAndVersion Get the latest release under the app
func (*ReleaseConfigDB) GetRelease ¶
func (client *ReleaseConfigDB) GetRelease(releaseID string) (*Release, error)
GetRelease Get Release
func (*ReleaseConfigDB) GetReleaseNamesByApp ¶
func (client *ReleaseConfigDB) GetReleaseNamesByApp(orgID, appID int64) ([]string, error)
GetReleaseNamesByApp Get releaseName list by appID
func (*ReleaseConfigDB) GetReleases ¶
func (client *ReleaseConfigDB) GetReleases(releaseIDs []string) ([]Release, error)
GetReleases list releases by release ids
func (*ReleaseConfigDB) GetReleasesByAppAndVersion ¶
func (client *ReleaseConfigDB) GetReleasesByAppAndVersion(orgID, projectID, appID int64, version string) ([]Release, error)
GetReleasesByAppAndVersion Get Release list by appID & version
func (*ReleaseConfigDB) GetReleasesByBranch ¶
func (client *ReleaseConfigDB) GetReleasesByBranch(projectID, appID int64, gitBranch string) ([]Release, error)
func (*ReleaseConfigDB) GetReleasesByParams ¶
func (client *ReleaseConfigDB) GetReleasesByParams( orgID int64, req *pb.ReleaseListRequest) (int64, []Release, error)
GetReleasesByParams filter Releases by parameters
func (*ReleaseConfigDB) GetReleasesByProjectAndVersion ¶
func (client *ReleaseConfigDB) GetReleasesByProjectAndVersion(orgID, projectID int64, version string) ([]Release, error)
func (*ReleaseConfigDB) GetUnReferedReleasesBefore ¶
func (client *ReleaseConfigDB) GetUnReferedReleasesBefore(before time.Time) ([]Release, error)
GetUnReferedReleasesBefore Get the Release that has not been referenced before a given point in time
func (*ReleaseConfigDB) UpdateRelease ¶
func (client *ReleaseConfigDB) UpdateRelease(release *Release) error
UpdateRelease Update Release