dao

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: 21 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

View Source
const BULK_INSERT_CHUNK_SIZE = 3000
View Source
const DIALECT = "mysql"

DIALECT db 类型

View Source
const IsDeleteValue = "Y"

Variables

View Source
var (
	ErrNotFoundOrg         = errors.New("org not found")
	ErrNotFoundProject     = errors.New("project not found")
	ErrNotFoundApplication = errors.New("application not found")
	ErrNotFoundMember      = errors.New("member not found")
	ErrNotFoundTicket      = errors.New("ticket not found")
	ErrNotFoundPublisher   = errors.New("publisher not found")
	ErrNotFoundCertificate = errors.New("certificate not found")
	ErrNotFoundApprove     = errors.New("approve not found")
	ErrNotFoundUsecase     = errors.New("usecase not found")
)

dao层错误码统一定义

Functions

func Count

func Count()

Count 记录cmdb运行时间,获取的容器数量,主机数量

func MakeHostLabel

func MakeHostLabel(hostLabels string) string

TODO deprecated MakeHostLabel 处理宿主机调度标签可读

func Round

func Round(f float64, n int) float64

Round 保留小数点计算

Types

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 DBClient

type DBClient struct {
	*gorm.DB
}

DBClient db client

func NewDBClient

func NewDBClient() (*DBClient, error)

NewDBClient create new db client

func (*DBClient) AllAddonsByCluster

func (client *DBClient) AllAddonsByCluster(ctx context.Context, cluster string) ([]types.CmContainer, error)

AllAddonsByCluster 获取集群所有的 dice addons containers

func (*DBClient) AllComponentsByCluster

func (client *DBClient) AllComponentsByCluster(ctx context.Context, cluster string) ([]types.CmContainer, error)

AllComponentsByCluster 获取集群所有的 dice components containers

func (*DBClient) AllContainersByAddon

func (client *DBClient) AllContainersByAddon(ctx context.Context, cluster string, addon []string) ([]types.CmContainer, error)

AllContainersByAddon 获取指定 addon 下所有的containers

func (*DBClient) AllContainersByApplication

func (client *DBClient) AllContainersByApplication(ctx context.Context, app []string) ([]types.CmContainer, error)

AllContainersByApplication 获取指定 appliaction 下所有 containers

func (*DBClient) AllContainersByCluster

func (client *DBClient) AllContainersByCluster(ctx context.Context, cluster string) ([]types.CmContainer, error)

AllContainersByCluster 获取整个 cluster 所有的 containers

func (*DBClient) AllContainersByComponent

func (client *DBClient) AllContainersByComponent(ctx context.Context, cluster string, component []string) ([]types.CmContainer, error)

AllContainersByComponent 获取指定 component 下所有的containers

func (*DBClient) AllContainersByHost

func (client *DBClient) AllContainersByHost(ctx context.Context, cluster string, host []string) ([]types.CmContainer, error)

AllContainersByHost 获取指定 host 下所有 containers

func (*DBClient) AllContainersByOrg

func (client *DBClient) AllContainersByOrg(ctx context.Context, org string) ([]types.CmContainer, error)

AllContainersByOrg 获取指定 org 下所有 containers

func (*DBClient) AllContainersByProject

func (client *DBClient) AllContainersByProject(ctx context.Context, project []string) ([]types.CmContainer, error)

AllContainersByProject 获取指定 project 下所有 containers

func (*DBClient) AllContainersByRuntime

func (client *DBClient) AllContainersByRuntime(ctx context.Context, runtime []string) ([]types.CmContainer, error)

AllContainersByRuntime 获取指定 runtime 下所有 containers

func (*DBClient) AllContainersByService

func (client *DBClient) AllContainersByService(ctx context.Context, runtime string, service []string) ([]types.CmContainer, error)

AllContainersByService 获取指定 service 下所有 containers

func (*DBClient) AllHostsByCluster

func (client *DBClient) AllHostsByCluster(ctx context.Context, cluster string) (*[]types.CmHost, error)

AllHostsByCluster 获取指定集群下所有的host信息

func (*DBClient) AllProjectsContainersByCluster

func (client *DBClient) AllProjectsContainersByCluster(ctx context.Context, cluster string) ([]types.CmContainer, error)

AllProjectsContainersByCluster 获取整个 cluster 所有通过 dice 创建的 containers

func (*DBClient) AllRunningAddonsByCluster

func (client *DBClient) AllRunningAddonsByCluster(ctx context.Context, cluster string) ([]types.CmContainer, error)

AllRunningAddonsByCluster 获取集群所有运行中的 dice addons containers

func (*DBClient) AllRunningComponentsByCluster

func (client *DBClient) AllRunningComponentsByCluster(ctx context.Context, cluster string) ([]types.CmContainer, error)

AllRunningComponentsByCluster 获取集群所有正在运行的 dice components containers

func (*DBClient) AllRunningContainersByApplication

func (client *DBClient) AllRunningContainersByApplication(ctx context.Context, app []string) ([]types.CmContainer, error)

AllRunningContainersByApplication 获取指定 appliaction 下所有正在运行的 containers

func (*DBClient) AllRunningContainersByCluster

func (client *DBClient) AllRunningContainersByCluster(ctx context.Context, cluster string) ([]types.CmContainer, error)

AllRunningContainersByCluster 获取整个 cluster 所有正在运行的 containers

func (*DBClient) AllRunningContainersByComponent

func (client *DBClient) AllRunningContainersByComponent(ctx context.Context, cluster string, component []string) ([]types.CmContainer, error)

AllRunningContainersByComponent 获取指定 component 下所有正在运行的 containers

func (*DBClient) AllRunningContainersByHost

func (client *DBClient) AllRunningContainersByHost(ctx context.Context, cluster string, host []string) ([]types.CmContainer, error)

AllRunningContainersByHost 获取指定 host 下所有运行中的 containers

func (*DBClient) AllRunningContainersByOrg

func (client *DBClient) AllRunningContainersByOrg(ctx context.Context, org string) ([]types.CmContainer, error)

AllRunningContainersByOrg 获取指定 org 下所有正在运行的 containers

func (*DBClient) AllRunningContainersByProject

func (client *DBClient) AllRunningContainersByProject(ctx context.Context, project []string) ([]types.CmContainer, error)

AllRunningContainersByProject 获取指定 project 下所有正在运行的 containers

func (*DBClient) AllRunningContainersByRuntime

func (client *DBClient) AllRunningContainersByRuntime(ctx context.Context, runtime []string) ([]types.CmContainer, error)

AllRunningContainersByRuntime 获取指定 runtime 下所有正在运行的 containers

func (*DBClient) AllRunningContainersByService

func (client *DBClient) AllRunningContainersByService(ctx context.Context, runtime string, service []string) ([]types.CmContainer, error)

AllRunningContainersByService 获取指定 service 下所有正在运行的 containers

func (*DBClient) AllRunningProjectsContainers

func (client *DBClient) AllRunningProjectsContainers(ctx context.Context) ([]types.CmContainer, error)

func (*DBClient) AllRunningProjectsContainersByCluster

func (client *DBClient) AllRunningProjectsContainersByCluster(ctx context.Context, cluster string) ([]types.CmContainer, error)

AllRunningProjectsContainersByCluster 获取整个 cluster 所有通过 dice 创建且正在运行的 containers

func (*DBClient) ArchiveAuditsByTimeAndOrg

func (client *DBClient) ArchiveAuditsByTimeAndOrg() error

ArchiveAuditsByTimeAndOrg 归档某个企业的审计事件

func (*DBClient) BatchCreateAudit

func (client *DBClient) BatchCreateAudit(audits []model.Audit) error

BatchCreateAudit 批量传教审计

func (*DBClient) BatchCreateIssueTestCaseRelations

func (client *DBClient) BatchCreateIssueTestCaseRelations(rels []IssueTestCaseRelation) error

BatchCreateIssueTestCaseRelations 批量创建关联关系

func (*DBClient) BatchCreateMemberExtra

func (client *DBClient) BatchCreateMemberExtra(memberExtras []model.MemberExtra) error

BatchCreateMemberExtra 批量创建成员关联关系

func (*DBClient) BatchGetNotifyGroup

func (client *DBClient) BatchGetNotifyGroup(ids []int64) ([]*apistructs.NotifyGroup, error)

BatchGetNotifyGroup 批量获取通知组

func (*DBClient) BatchQueryIssueLabelIDMap

func (client *DBClient) BatchQueryIssueLabelIDMap(issueIDs []int64) (map[uint64][]uint64, error)

BatchGetIssueLabelIDMap 批量查询 issue label id

func (*DBClient) BatchUpdateIssues

func (client *DBClient) BatchUpdateIssues(req *apistructs.IssueBatchUpdateRequest) error

BatchUpdateIssues 批量更新 issue

func (*DBClient) BulkInsert

func (client *DBClient) BulkInsert(objects interface{}, excludeColumns ...string) error

func (*DBClient) CancelQuoteCertificate

func (client *DBClient) CancelQuoteCertificate(quoteCertificateID int64) error

CancelQuoteCertificate 取消引用Certificate

func (*DBClient) CheckNotifyGroupNameExist

func (client *DBClient) CheckNotifyGroupNameExist(scopeType, scopeID, name string) (bool, error)

func (*DBClient) CheckNotifyNameExist

func (client *DBClient) CheckNotifyNameExist(scopeType, scopeID, name, label string) (bool, error)

func (*DBClient) CleanIssueRelation

func (client *DBClient) CleanIssueRelation(issueID uint64) error

ClearIssueRelation 清理所有的issue关联关系

func (*DBClient) CreateAccount

func (client *DBClient) CreateAccount(account *model.CloudAccount) error

CreateCloudAccount 创建云账号

func (*DBClient) CreateApplication

func (client *DBClient) CreateApplication(application *model.Application) error

CreateApplication 创建应用

func (*DBClient) CreateApprove

func (client *DBClient) CreateApprove(approve *model.Approve) error

CreateApprove 创建Approve

func (*DBClient) CreateAudit

func (client *DBClient) CreateAudit(audit *model.Audit) error

CreateAudit 创建审计

func (*DBClient) CreateBranchRule

func (client *DBClient) CreateBranchRule(branchRule *model.BranchRule) error

CreateBranchRule 创建分支规则

func (*DBClient) CreateCertificate

func (client *DBClient) CreateCertificate(certificate *model.Certificate) error

CreateCertificate 创建Certificate

func (*DBClient) CreateCluster

func (client *DBClient) CreateCluster(cluster *model.Cluster) error

CreateCluster 创建集群

func (*DBClient) CreateComment

func (client *DBClient) CreateComment(comment *model.Comment) error

CreateComment 创建工单评论

func (*DBClient) CreateContainer

func (client *DBClient) CreateContainer(container *model.Container) error

CreateContainer 创建容器

func (*DBClient) CreateCurrentOrg

func (client *DBClient) CreateCurrentOrg(orgRelation *model.CurrentOrg) error

CreateCurrentOrg 添加用户当前所属企业

func (*DBClient) CreateDeployment

func (client *DBClient) CreateDeployment(deployment *model.Deployments) error

CreateDeployment 创建正在运行的deployment

func (*DBClient) CreateErrorLog

func (client *DBClient) CreateErrorLog(errorLog *model.ErrorLog) error

CreateErrorLog 创建错误日志

func (*DBClient) CreateFavoritedResource

func (client *DBClient) CreateFavoritedResource(resource *model.FavoritedResource) error

CreateFavoritedResource 创建收藏关系

func (*DBClient) CreateFile

func (client *DBClient) CreateFile(file *File) error

func (*DBClient) CreateHost

func (client *DBClient) CreateHost(host *model.Host) error

CreateHost 创建host

func (*DBClient) CreateIssue

func (client *DBClient) CreateIssue(issue *Issue) error

Issue 创建

func (*DBClient) CreateIssueAppRelation

func (client *DBClient) CreateIssueAppRelation(issueAppRel *IssueAppRelation) error

CreateIssueAppRelation 创建事件应用关联关系

func (*DBClient) CreateIssueProperty

func (client *DBClient) CreateIssueProperty(property *IssueProperty) error

func (*DBClient) CreateIssuePropertyValue

func (client *DBClient) CreateIssuePropertyValue(value *IssuePropertyValue) error

func (*DBClient) CreateIssuePropertyValues

func (client *DBClient) CreateIssuePropertyValues(values []IssuePropertyValue) error

func (*DBClient) CreateIssueRelations

func (client *DBClient) CreateIssueRelations(issueRelation *IssueRelation) error

CreateIssueRelations 创建事件与事件的关联关系

func (*DBClient) CreateIssueStage

func (client *DBClient) CreateIssueStage(stages []IssueStage) error

func (*DBClient) CreateIssueStream

func (client *DBClient) CreateIssueStream(is *IssueStream) error

CreateIssueStream 创建 issue 事件流

func (*DBClient) CreateIssuesState

func (client *DBClient) CreateIssuesState(state *IssueState) error

func (*DBClient) CreateIteration

func (client *DBClient) CreateIteration(Iteration *Iteration) error

Iteration 创建

func (*DBClient) CreateJob

func (client *DBClient) CreateJob(Job *model.Jobs) error

CreateJob 创建正在运行的Job

func (*DBClient) CreateLabel

func (client *DBClient) CreateLabel(label *Label) error

CreateLabel 创建 label

func (*DBClient) CreateLabelRelation

func (client *DBClient) CreateLabelRelation(lr *LabelRelation) error

CreateLabelRelation 创建标签关联关系

func (*DBClient) CreateLibReference

func (client *DBClient) CreateLibReference(libReference *LibReference) error

CreateLibReference 创建库引用

func (*DBClient) CreateMBox

func (client *DBClient) CreateMBox(request *apistructs.CreateMBoxRequest) error

func (*DBClient) CreateMember

func (client *DBClient) CreateMember(member *model.Member) error

CreateMember 创建成员

func (*DBClient) CreateMemberExtra

func (client *DBClient) CreateMemberExtra(memberExtra *model.MemberExtra) error

CreateMemberExtra 创建成员关联关系

func (*DBClient) CreateNotice

func (client *DBClient) CreateNotice(notice *Notice) error

CreateNotice 创建公告

func (*DBClient) CreateNotify

func (client *DBClient) CreateNotify(request *apistructs.CreateNotifyRequest) (int64, error)

func (*DBClient) CreateNotifyGroup

func (client *DBClient) CreateNotifyGroup(request *apistructs.CreateNotifyGroupRequest) (int64, error)

CreateNotifyGroup 创建通知组

func (*DBClient) CreateNotifyHistory

func (client *DBClient) CreateNotifyHistory(request *apistructs.CreateNotifyHistoryRequest) (int64, error)

func (*DBClient) CreateNotifyItem

func (client *DBClient) CreateNotifyItem(request *apistructs.CreateNotifyItemRequest) (int64, error)

func (*DBClient) CreateOrUpdateNexusRepository

func (client *DBClient) CreateOrUpdateNexusRepository(repo *NexusRepository) error

func (*DBClient) CreateOrUpdateNexusUser

func (client *DBClient) CreateOrUpdateNexusUser(user *NexusUser) error

func (*DBClient) CreateOrUpdateService

func (client *DBClient) CreateOrUpdateService(ctx context.Context, service *types.CmService) error

CreateOrUpdateService 更新服务信息

func (*DBClient) CreateOrg

func (client *DBClient) CreateOrg(org *model.Org) error

CreateOrg 创建企业

func (*DBClient) CreateOrgClusterRelation

func (client *DBClient) CreateOrgClusterRelation(relation *model.OrgClusterRelation) error

CreateOrgClusterRelation 创建企业集群关系

func (*DBClient) CreatePanel

func (client *DBClient) CreatePanel(panel *IssuePanel) error

func (*DBClient) CreateProject

func (client *DBClient) CreateProject(project *model.Project) error

CreateProject 创建项目

func (*DBClient) CreatePropertyRelation

func (client *DBClient) CreatePropertyRelation(relation *IssuePropertyRelation) error

func (*DBClient) CreatePropertyRelations

func (client *DBClient) CreatePropertyRelations(relations []IssuePropertyRelation) error

func (*DBClient) CreatePublisher

func (client *DBClient) CreatePublisher(publisher *model.Publisher) error

CreatePublisher 创建Publisher

func (*DBClient) CreateReview

func (client *DBClient) CreateReview(review *model.ManualReview) error

func (*DBClient) CreateReviewUser

func (client *DBClient) CreateReviewUser(review *model.ReviewUser) error

func (*DBClient) CreateRolePermission

func (client *DBClient) CreateRolePermission(permission *model.RolePermission) error

CreateRolePermission 创建角色权限

func (*DBClient) CreateTicket

func (client *DBClient) CreateTicket(ticket *model.Ticket) error

CreateTicket 创建工单

func (*DBClient) DeleteAccount

func (client *DBClient) DeleteAccount(orgID, accountID int64) error

DeleteCloudAccount 删除云账号

func (*DBClient) DeleteAllContainersByHost

func (client *DBClient) DeleteAllContainersByHost(ctx context.Context, cluster, host string) error

DeleteAllContainersByHost 删除指定 host 下所有 containers

func (*DBClient) DeleteApplication

func (client *DBClient) DeleteApplication(applicationID int64) error

DeleteApplication 删除应用

func (*DBClient) DeleteApprove

func (client *DBClient) DeleteApprove(approveID int64) error

DeleteApprove 删除Approve

func (*DBClient) DeleteAuditsByTimeAndOrg

func (client *DBClient) DeleteAuditsByTimeAndOrg(startTime time.Time, orgIDs []uint64) error

DeleteAuditsByTimeAndOrg 软删除某个企业的审计事件

func (*DBClient) DeleteAuditsByTimeAndSys

func (client *DBClient) DeleteAuditsByTimeAndSys(startTime time.Time) error

DeleteAuditsByTimeAndSys 软删除系统级别的审计事件

func (*DBClient) DeleteBranchRule

func (client *DBClient) DeleteBranchRule(id int64) error

DeleteBranchRule 删除分支规则

func (*DBClient) DeleteBranchRuleByScope

func (client *DBClient) DeleteBranchRuleByScope(scopeType apistructs.ScopeType, scopeID int64) error

DeleteBranchRuleByScope 批量删除分支规则

func (*DBClient) DeleteCertificate

func (client *DBClient) DeleteCertificate(certificateID int64) error

DeleteCertificate 删除Certificate

func (*DBClient) DeleteCluster

func (client *DBClient) DeleteCluster(clusterName string) error

DeleteCluster 删除集群

func (*DBClient) DeleteContainer

func (client *DBClient) DeleteContainer(ctx context.Context, c *types.CmContainer) error

DeleteContainer 删除 container 信息

func (*DBClient) DeleteCurrentOrg

func (client *DBClient) DeleteCurrentOrg(userID string) error

DeleteCurrentOrg 删除当前用户所属企业

func (*DBClient) DeleteDeployment

func (client *DBClient) DeleteDeployment(orgID string, taskID uint64) error

DeleteDeployment 删除 deployment 信息

func (*DBClient) DeleteFavoritedResource

func (client *DBClient) DeleteFavoritedResource(id uint64) error

DeleteFavoritedResource 删除收藏关系

func (*DBClient) DeleteFavoritedResourcesByTarget

func (client *DBClient) DeleteFavoritedResourcesByTarget(target string, targetID uint64) error

DeleteFavoritedResourcesByTarget 根据 target 删除收藏关系

func (*DBClient) DeleteFile

func (client *DBClient) DeleteFile(id uint64) error

func (*DBClient) DeleteHostByName

func (client *DBClient) DeleteHostByName(ctx context.Context, cluster, name string) error

DeleteHostByName 根据名字删除指定集群下指定的宿主机

func (*DBClient) DeleteIssue

func (client *DBClient) DeleteIssue(id uint64) error

DeleteIssue 删除

func (*DBClient) DeleteIssueAppRelationsByApp

func (client *DBClient) DeleteIssueAppRelationsByApp(appID int64) error

DeleteIssueAppRelationsByApp 根据 appID 删除关联关系

func (*DBClient) DeleteIssueAppRelationsByComment

func (client *DBClient) DeleteIssueAppRelationsByComment(commentID int64) error

DeleteIssueAppRelationsByComment 根据 commentID 删除关联关系

func (*DBClient) DeleteIssueProperty

func (client *DBClient) DeleteIssueProperty(orgId int64, propertyIssueType apistructs.PropertyIssueType, id int64, index int64) error

func (*DBClient) DeleteIssuePropertyValue

func (client *DBClient) DeleteIssuePropertyValue(id int64) error

func (*DBClient) DeleteIssuePropertyValuesByPropertyID

func (client *DBClient) DeleteIssuePropertyValuesByPropertyID(propertyID int64) error

func (*DBClient) DeleteIssueRelation

func (client *DBClient) DeleteIssueRelation(issueID, relatedIssueID uint64) error

DeleteIssueRelation 删除两条issue之间的关联关系

func (*DBClient) DeleteIssueTestCaseRelationsByIDs

func (client *DBClient) DeleteIssueTestCaseRelationsByIDs(ids []uint64) error

DeleteIssueTestCaseRelationsByIDs 根据关联关系 id 删除

func (*DBClient) DeleteIssueTestCaseRelationsByIssueID

func (client *DBClient) DeleteIssueTestCaseRelationsByIssueID(issueID uint64) error

DeleteIssueTestCaseRelationsByIssueID 根据 issue id 删除关联关系

func (*DBClient) DeleteIssuesByRequirement

func (client *DBClient) DeleteIssuesByRequirement(requirementID uint64) error

DeleteIssuesByRequirement

func (*DBClient) DeleteIssuesStage

func (client *DBClient) DeleteIssuesStage(orgID int64, issueType apistructs.IssueType) error

func (*DBClient) DeleteIssuesState

func (client *DBClient) DeleteIssuesState(id int64) error

func (*DBClient) DeleteIssuesStateByProjectID

func (client *DBClient) DeleteIssuesStateByProjectID(projectID int64) error

func (*DBClient) DeleteIssuesStateRelationByStartID

func (client *DBClient) DeleteIssuesStateRelationByStartID(id int64) error

func (*DBClient) DeleteIteration

func (client *DBClient) DeleteIteration(id uint64) error

Iteration 删除

func (*DBClient) DeleteJob

func (client *DBClient) DeleteJob(orgID string, taskID uint64) error

DeleteJob 删除 Job 信息

func (*DBClient) DeleteLabel

func (client *DBClient) DeleteLabel(labelID int64) error

DeleteLabel 删除标签

func (*DBClient) DeleteLabelRelations

func (client *DBClient) DeleteLabelRelations(refType apistructs.ProjectLabelType, refID uint64) error

DeleteLabelRelations 删除标签关联关系

func (*DBClient) DeleteLabelRelationsByLabel

func (client *DBClient) DeleteLabelRelationsByLabel(labelID uint64) error

DeleteLabelRelationsByLabel 根据 labelID 删除标签

func (*DBClient) DeleteLibReference

func (client *DBClient) DeleteLibReference(libReferenceID uint64) error

DeleteLibReference 删除库引用

func (*DBClient) DeleteMBox

func (client *DBClient) DeleteMBox(id int64) error

func (*DBClient) DeleteMember

func (client *DBClient) DeleteMember(memberID int64) error

DeleteMember 删除成员

func (*DBClient) DeleteMemberByScopeAndUsersAndRole

func (client *DBClient) DeleteMemberByScopeAndUsersAndRole(userIDs []string, scopeType apistructs.ScopeType, scopeID int64, role string) error

DeleteMemberByScopeAndUsersAndRole 根据scope, userID, role删除成员,多角色状态下,更新用户角色时用到, todo delete

func (*DBClient) DeleteMemberExtraByIDsANDResourceValues

func (client *DBClient) DeleteMemberExtraByIDsANDResourceValues(userIDs []string, scopeType apistructs.ScopeType,
	scopeIDs []int64, resourceValues []string) error

DeleteMemberExtraByIDsANDResourceValues 根据userIDs, scope和resourceValues删除成员标签

func (*DBClient) DeleteMemberExtraByParentID

func (client *DBClient) DeleteMemberExtraByParentID(userIDs []string, scopeType apistructs.ScopeType, parentID int64) error

DeleteMemberExtraByParentID 根据parentID删除成员关联关系

func (*DBClient) DeleteMemberExtraByParentIDs

func (client *DBClient) DeleteMemberExtraByParentIDs(userID []string, scopeType apistructs.ScopeType, parentIDs []int64) error

DeleteMemberExtraByParentIDs 根据多个parentID删除成员关联关系

func (*DBClient) DeleteMemberExtraByScope

func (client *DBClient) DeleteMemberExtraByScope(scopeType apistructs.ScopeType, scopeID int64) error

DeleteMemberExtraByScope 根据scope信息删除成员

func (*DBClient) DeleteMemberExtraByUserIDsAndScope

func (client *DBClient) DeleteMemberExtraByUserIDsAndScope(scopeType apistructs.ScopeType, scopeID int64,
	userIDs []string) error

DeleteMemberExtraByUserIDsAndScope 根据userID和scope删除成员关联关系

func (*DBClient) DeleteMemberExtraByUserIDsAndScopeIDs

func (client *DBClient) DeleteMemberExtraByUserIDsAndScopeIDs(scopeType apistructs.ScopeType, scopeIDs []int64,
	userIDs []string) error

DeleteMemberExtraByUserIDsAndScopeIDs 根据userID和多个scopeID删除成员关联关系

func (*DBClient) DeleteMemberExtraByUxerIDANDResourceValues

func (client *DBClient) DeleteMemberExtraByUxerIDANDResourceValues(userID string, scopeType apistructs.ScopeType,
	scopeIDs []int64, resourceValues []string) error

DeleteMemberExtraByUxerIDANDResourceValues 根据userID, scope和resourceValues删除成员标签

func (*DBClient) DeleteMembersByOrgAndUsers

func (client *DBClient) DeleteMembersByOrgAndUsers(orgID string, userIDs []string) error

DeleteMembersByOrgAndUsers 根据 userIDs 删除成员信息 (用户踢出企业时使用)

func (*DBClient) DeleteMembersByScope

func (client *DBClient) DeleteMembersByScope(scopeType apistructs.ScopeType, scopeID int64) error

DeleteMembersByScope 根据scope删除成员

func (*DBClient) DeleteMembersByScopeAndUsers

func (client *DBClient) DeleteMembersByScopeAndUsers(userIDs []string, scopeType apistructs.ScopeType, scopeID int64) error

DeleteMembersByScopeAndUsers 根据scope & userID删除成员

func (*DBClient) DeleteNotice

func (client *DBClient) DeleteNotice(noticeID uint64) error

DeleteNotice 删除公告

func (*DBClient) DeleteNotify

func (client *DBClient) DeleteNotify(id int64, withGroup bool, orgID int64) error

func (*DBClient) DeleteNotifyGroup

func (client *DBClient) DeleteNotifyGroup(id int64, orgID int64) error

func (*DBClient) DeleteNotifyItem

func (client *DBClient) DeleteNotifyItem(id int64) error

func (*DBClient) DeleteNotifyRelationsByScope

func (client *DBClient) DeleteNotifyRelationsByScope(scopeType apistructs.ScopeType, scopeID string) error

DeleteNotifyRelationByScope 删除对应关联的通知信息

func (*DBClient) DeleteNotifySource

func (client *DBClient) DeleteNotifySource(request *apistructs.DeleteNotifySourceRequest) error

func (*DBClient) DeleteOrg

func (client *DBClient) DeleteOrg(orgID int64) error

DeleteOrg 删除企业

func (*DBClient) DeleteOrgClusterRelationByCluster

func (client *DBClient) DeleteOrgClusterRelationByCluster(clusterName string) error

DeleteOrgClusterRelationByCluster 根据 clusterName 删除企业集群关联关系

func (*DBClient) DeleteOrgClusterRelationByClusterAndOrg

func (client *DBClient) DeleteOrgClusterRelationByClusterAndOrg(clusterName string, orgID int64) error

DeleteOrgClusterRelationByClusterAndOrg 根据 clusterName、orgID 删除企业集群关联关系

func (*DBClient) DeletePanelByPanelID

func (client *DBClient) DeletePanelByPanelID(panelID int64) error

func (*DBClient) DeleteProject

func (client *DBClient) DeleteProject(projectID int64) error

DeleteProject 删除项目

func (*DBClient) DeleteProjectAppsMembers

func (client *DBClient) DeleteProjectAppsMembers(userIDs []string, projectID int64) error

DeleteProjectAppsMembers 删除该用户对应项目下的应用权限

func (*DBClient) DeletePropertyRelationByIssueID

func (client *DBClient) DeletePropertyRelationByIssueID(issueID int64) error

func (*DBClient) DeletePropertyRelationsByPropertyID

func (client *DBClient) DeletePropertyRelationsByPropertyID(issueID int64, propertyID int64) error

func (*DBClient) DeletePublisher

func (client *DBClient) DeletePublisher(publisherID int64) error

DeletePublisher 删除Publisher

func (*DBClient) DeleteStoppedContainersByPeriod

func (client *DBClient) DeleteStoppedContainersByPeriod(ctx context.Context, period time.Duration) error

DeleteStoppedContainersByPeriod 删除指定时间前,且已经停止的 containers

func (*DBClient) DeleteTicket

func (client *DBClient) DeleteTicket(targetID, targetType, ticketType string) error

DeleteTicket 删除工单

func (*DBClient) FindIssueStream

func (client *DBClient) FindIssueStream(issueId int) ([]IssueStream, error)

func (*DBClient) FindIterations

func (client *DBClient) FindIterations(projectID uint64) (iterations []Iteration, err error)

func (*DBClient) FuzzyQueryNotifiesBySource

func (client *DBClient) FuzzyQueryNotifiesBySource(req apistructs.FuzzyQueryNotifiesBySourceRequest) ([]*apistructs.NotifyDetail, int, error)

func (*DBClient) GetAbnormalHostsNumberByClusterAndOrg

func (client *DBClient) GetAbnormalHostsNumberByClusterAndOrg(clusterName, orgName string) (uint64, error)

GetAbnormalHostsNumberByClusterAndOrg 根据 clusterName & orgName 获取集群异常主机总数

func (*DBClient) GetAccountByID

func (client *DBClient) GetAccountByID(orgID, accountID int64) (model.CloudAccount, error)

GetAccountByID 根据 ID 获取云账号

func (*DBClient) GetAccountByName

func (client *DBClient) GetAccountByName(orgID int64, name string) (model.CloudAccount, error)

GetAccountByName 根据 OrgID & Name 获取云账号

func (*DBClient) GetAccountsByOrgID

func (client *DBClient) GetAccountsByOrgID(orgID int64) ([]model.CloudAccount, error)

GetAccountsByOrg 根据 OrgID 获取云账号列表

func (*DBClient) GetAccumulateResource

func (client *DBClient) GetAccumulateResource(cluster, resource string) (uint64, error)

GetAccumulateResource 根据resource(项目、应用、runtime)类型,获取指定集群对应的数量

func (*DBClient) GetActivitiesByRuntime

func (client *DBClient) GetActivitiesByRuntime(runtimeID int64, pageNo, pageSize int) (int, []model.Activity, error)

GetActivitiesByRuntime 根据runtimeID获取活动列表

func (*DBClient) GetAllApps

func (client *DBClient) GetAllApps() ([]model.Application, error)

GetAllApps 获取所有app列表

func (*DBClient) GetAllProjects

func (client *DBClient) GetAllProjects() ([]model.Project, error)

GetAllProjects

func (*DBClient) GetAppCertificateByAppIDAndCertificateID

func (client *DBClient) GetAppCertificateByAppIDAndCertificateID(appID, quoteCertificateID uint64) (*model.AppCertificate, error)

GetAppCertificateByAppIDAndCertificateID 根据certificateID获取应用Certificate信息

func (*DBClient) GetAppCertificateByApprovalID

func (client *DBClient) GetAppCertificateByApprovalID(approvalID int64) (*model.AppCertificate, error)

GetAppCertificateByApprovalID 根据certificateID获取应用Certificate信息

func (*DBClient) GetAppCertificateByID

func (client *DBClient) GetAppCertificateByID(quoteCertificateID uint64) (model.AppCertificate, error)

GetAppCertificateByID 根据certificateID获取应用Certificate信息

func (*DBClient) GetAppCertificatesByOrgIDAndName

func (client *DBClient) GetAppCertificatesByOrgIDAndName(params *apistructs.AppCertificateListRequest) (
	int, []model.AppCertificate, error)

GetAppCertificatesByOrgIDAndName 根据appID和状态获取Certificate列表

func (*DBClient) GetAppMembersByUser

func (client *DBClient) GetAppMembersByUser(userID string) ([]model.MemberExtra, error)

GetAppMembersByUser 根据userID查询应用权限

func (*DBClient) GetApplicationByID

func (client *DBClient) GetApplicationByID(applicationID int64) (model.Application, error)

GetApplicationByID 根据applicationID获取应用信息

func (*DBClient) GetApplicationByName

func (client *DBClient) GetApplicationByName(projectID int64, name string) (model.Application, error)

GetApplicationByName 根据projectID & name获取应用

func (*DBClient) GetApplicationByOrgAndName

func (client *DBClient) GetApplicationByOrgAndName(orgID int64, name string) (*model.Application, error)

GetApplicationByOrgAndName 根据orgID & 应用名称获取应用

func (*DBClient) GetApplicationCountByProjectID

func (client *DBClient) GetApplicationCountByProjectID(projectID int64) (int64, error)

GetApplicationCountByProjectID 根据projectID获取应用总数

func (*DBClient) GetApplicationsByIDs

func (client *DBClient) GetApplicationsByIDs(orgID *int64, projectID *int64, applicationIDs []int64, request *apistructs.ApplicationListRequest) (
	int, []model.Application, error)

GetApplicationsByIDs 根据applicationIDs & 名称模糊匹配获取应用列表

func (*DBClient) GetApplicationsByProjectID

func (client *DBClient) GetApplicationsByProjectID(projectID, pageNum, pageSize int64) ([]model.Application, error)

GetApplicationsByProjectID 根据projectID获取应用列表

func (*DBClient) GetApplicationsByProjectIDs

func (client *DBClient) GetApplicationsByProjectIDs(projectIDs []uint64) ([]model.Application, error)

GetApplicationsByProjectIDs 根据项目ID列表批量查询应用

func (*DBClient) GetApproveByID

func (client *DBClient) GetApproveByID(approveID int64) (model.Approve, error)

GetApproveByID 根据approveID获取Approve信息

func (*DBClient) GetApproveByOrgAndID

func (client *DBClient) GetApproveByOrgAndID(approveType apistructs.ApproveType,
	orgID, targetTD, entityID uint64) (*model.Approve, error)

GetApproveByOrgAndName 根据orgID & Approve名称 获取证书信息

func (*DBClient) GetApprovesByOrgIDAndStatus

func (client *DBClient) GetApprovesByOrgIDAndStatus(params *apistructs.ApproveListRequest) (
	int, []model.Approve, error)

GetApprovesByOrgIDAndStatus 根据orgID与审批状态获取Approve列表

func (*DBClient) GetAuditCleanCron

func (client *DBClient) GetAuditCleanCron(orgID int64) (*model.Org, error)

GetAuditCleanCron 获取企业事件清理周期

func (*DBClient) GetAuditSettings

func (client *DBClient) GetAuditSettings() ([]model.AuditSettings, error)

GetAuditSettings 从 dice_org 获取审计事件清理周期

func (*DBClient) GetAuditsByParam

func (client *DBClient) GetAuditsByParam(param *apistructs.AuditsListRequest) (int, []model.Audit, error)

GetAuditsByParam 通过参数查询成员

func (*DBClient) GetBatchUpdateIssues

func (client *DBClient) GetBatchUpdateIssues(req *apistructs.IssueBatchUpdateRequest) ([]Issue, error)

GetBatchUpdateIssues 获取待批量更新记录,生成活动记录

func (*DBClient) GetBranchRule

func (client *DBClient) GetBranchRule(id int64) (model.BranchRule, error)

GetBranchRule 获取分支规则

func (*DBClient) GetBranchRulesCount

func (client *DBClient) GetBranchRulesCount(scopeType apistructs.ScopeType) (int64, error)

GetBranchRulesCount 查询分支规则数量

func (*DBClient) GetCertificateByID

func (client *DBClient) GetCertificateByID(certificateID int64) (model.Certificate, error)

GetCertificateByID 根据certificateID获取Certificate信息

func (*DBClient) GetCertificateByOrgAndName

func (client *DBClient) GetCertificateByOrgAndName(orgID int64, name string) (*model.Certificate, error)

GetCertificateByOrgAndName 根据orgID & Certificate名称 获取证书信息

func (*DBClient) GetCertificatesByIDs

func (client *DBClient) GetCertificatesByIDs(certificateIDs []int64, params *apistructs.CertificateListRequest) (
	int, []model.Certificate, error)

GetCertificatesByIDs 根据certificateIDs获取Certificate列表

func (*DBClient) GetCertificatesByOrgIDAndName

func (client *DBClient) GetCertificatesByOrgIDAndName(orgID int64, params *apistructs.CertificateListRequest) (
	int, []model.Certificate, error)

GetCertificatesByOrgIDAndName 根据orgID与名称获取Certificate列表

func (*DBClient) GetClosedBugState

func (client *DBClient) GetClosedBugState(projectID int64) ([]IssueState, error)

GetClosedBugState 获取一个项目下已关闭的bug状态id

func (*DBClient) GetCluster

func (client *DBClient) GetCluster(clusterID int64) (*model.Cluster, error)

GetCluster 获取集群详情

func (*DBClient) GetClusterByName

func (client *DBClient) GetClusterByName(clusterName string) (*model.Cluster, error)

GetClusterByName 根据集群名称获取集群详情

func (*DBClient) GetClusterOpenTicketsNum

func (client *DBClient) GetClusterOpenTicketsNum(ticketType, targetType, targetID string) (uint64, error)

GetClusterOpenTicketsNum 获取指定集群open状态的工单总数

func (*DBClient) GetCommentByID

func (client *DBClient) GetCommentByID(commentID int64) (*model.Comment, error)

GetCommentByID 根据commentID获取评论

func (*DBClient) GetCommentsByTicketID

func (client *DBClient) GetCommentsByTicketID(ticketID int64, pageNo, pageSize int) (int64, []model.Comment, error)

GetCommentsByTicketID 根据ticketID获取工单评论

func (*DBClient) GetContainerByTaskIDOrContainerID

func (client *DBClient) GetContainerByTaskIDOrContainerID(cluster, taskID, containerID string) ([]model.Container, error)

GetContainerByTaskIDOrContainerID 根据 taskID 或 containerID 获取实例列表

  1. scheduler事件暂时只有taskID(marathon集群唯一, k8s集群为podID)
  2. telegraf推送事件taskID & containerID都不为空

func (*DBClient) GetCountByCertificateID

func (client *DBClient) GetCountByCertificateID(certificateID int64) (int64, error)

GetCountByCertificateID 根据certificateID获取引用总数

func (*DBClient) GetCurrentOrgByUser

func (client *DBClient) GetCurrentOrgByUser(userID string) (int64, error)

GetCurrentOrgByUser 根据userID获取当前所属企业ID

func (*DBClient) GetDeployment

func (client *DBClient) GetDeployment(orgID string, taskID uint64) []model.Deployments

GetDeployment 获取部署信息

func (*DBClient) GetEnvConfigByID

func (client *DBClient) GetEnvConfigByID(configID int64) (*model.ConfigItem, error)

GetEnvConfigByID 根据 ID 获取 配置信息

func (*DBClient) GetEnvConfigByKey

func (client *DBClient) GetEnvConfigByKey(namespaceID int64, key string) (*model.ConfigItem, error)

GetEnvConfigByKey 根据 namespaceID, key 获取某个配置信息

func (*DBClient) GetEnvConfigsByNamespaceID

func (client *DBClient) GetEnvConfigsByNamespaceID(namespaceID int64) ([]model.ConfigItem, error)

GetEnvConfigsByNamespaceID 根据 namespaceID 获取所有配置信息

func (*DBClient) GetErrorLogByDedupIndex

func (client *DBClient) GetErrorLogByDedupIndex(resourceID string, resourceType apistructs.ErrorResourceType,
	dedupID string) (*model.ErrorLog, error)

GetErrorLogByDedupIndex 根据唯一索引获取错误日志记录

func (*DBClient) GetFavoritedResource

func (client *DBClient) GetFavoritedResource(target string, targetID uint64, userID string) (*model.FavoritedResource, error)

GetFavoritedResource 查询收藏关系

func (*DBClient) GetFavoritedResourcesByUser

func (client *DBClient) GetFavoritedResourcesByUser(target, userID string) ([]model.FavoritedResource, error)

GetFavoritedResourcesByUser 查询收藏关系

func (*DBClient) GetFile

func (client *DBClient) GetFile(id uint64) (File, error)

func (*DBClient) GetFileByUUID

func (client *DBClient) GetFileByUUID(uuid string) (File, error)

func (*DBClient) GetHostByClusterAndIP

func (client *DBClient) GetHostByClusterAndIP(clusterName, privateAddr string) (*model.Host, error)

GetHostByClusterAndIP 根据 cluster & privateAddr获取主机信息

func (*DBClient) GetHostsByCluster

func (client *DBClient) GetHostsByCluster(clusterName string) (*[]model.Host, error)

GetHostsByCluster 根据 clusterName获取主机列表

func (*DBClient) GetHostsByClusterAndNullOrg

func (client *DBClient) GetHostsByClusterAndNullOrg(clusterName string) (*[]model.Host, error)

GetHostsByClusterAndNullOrg 为兼容dcos 有些机器未加 org 标

func (*DBClient) GetHostsByClusterAndOrg

func (client *DBClient) GetHostsByClusterAndOrg(clusterName, orgName string) (*[]model.Host, error)

GetHostsByClusterAndOrg 根据 clusterName & orgName 获取主机列表

func (*DBClient) GetHostsNumber

func (client *DBClient) GetHostsNumber() (uint64, error)

GetHostsNumber 查询host数量

func (*DBClient) GetHostsNumberByClusterAndOrg

func (client *DBClient) GetHostsNumberByClusterAndOrg(clusterName, orgName string) (uint64, error)

GetHostsNumberByClusterAndOrg 根据 clusterName & orgName 获取集群主机总数

func (*DBClient) GetIssue

func (client *DBClient) GetIssue(id int64) (Issue, error)

GetIssue 查询事件

func (*DBClient) GetIssueBugByRange

func (client *DBClient) GetIssueBugByRange(req apistructs.IssuesStageRequest) ([]Issue, float32, error)

GetIssueByRange 通过迭代或项目获取issue Bug

func (*DBClient) GetIssueByIssueIDs

func (client *DBClient) GetIssueByIssueIDs(issueIDs []uint64) ([]Issue, error)

GetIssueByIssueIDs 通过issueid获取issue

func (*DBClient) GetIssueByState

func (client *DBClient) GetIssueByState(state int64) (*Issue, error)

GetIssueByState 通过状态获取issue

func (*DBClient) GetIssueManHourSum

GetIssueManHourSum 事件下所有的任务总和

func (*DBClient) GetIssueProperties

func (client *DBClient) GetIssueProperties(req apistructs.IssuePropertiesGetRequest) ([]IssueProperty, error)

func (*DBClient) GetIssuePropertiesByRelation

func (client *DBClient) GetIssuePropertiesByRelation(ID int64) (*IssueProperty, error)

func (*DBClient) GetIssuePropertiesByTime

func (client *DBClient) GetIssuePropertiesByTime(orgID int64) ([]IssueProperty, error)

func (*DBClient) GetIssuePropertyByID

func (client *DBClient) GetIssuePropertyByID(id int64) (*IssueProperty, error)

func (*DBClient) GetIssuePropertyByName

func (client *DBClient) GetIssuePropertyByName(orgID int64, Name string, PropertyIssueType apistructs.PropertyIssueType) (*IssueProperty, error)

GetIssuePropertyByName 根据 name 获取 property 信息

func (*DBClient) GetIssuePropertyValue

func (client *DBClient) GetIssuePropertyValue(id int64) (*IssuePropertyValue, error)

func (*DBClient) GetIssuePropertyValues

func (client *DBClient) GetIssuePropertyValues(orgID int64) ([]IssuePropertyValue, error)

func (*DBClient) GetIssueRelationsByIDs

func (client *DBClient) GetIssueRelationsByIDs(issueIDs []uint64) ([]IssueRelation, error)

func (*DBClient) GetIssueStateByID

func (client *DBClient) GetIssueStateByID(ID int64) (*IssueState, error)

func (*DBClient) GetIssueStateByIDs

func (client *DBClient) GetIssueStateByIDs(ID []int64) ([]IssueState, error)

func (*DBClient) GetIssueStatePermission

func (client *DBClient) GetIssueStatePermission(role string, st int64, ed int64) (*IssueStateRelation, error)

func (*DBClient) GetIssueSummary

func (client *DBClient) GetIssueSummary(iterationID int64, task, bug, requirement []int64) apistructs.ISummary

GetIssueSummary 获取迭代相关的issue统计信息

func (*DBClient) GetIssueWithOutDelete

func (client *DBClient) GetIssueWithOutDelete(id int64) (Issue, error)

GetIssue 查询事件

func (*DBClient) GetIssuesStage

func (client *DBClient) GetIssuesStage(orgID int64, issueType apistructs.IssueType) ([]IssueStage, error)

func (*DBClient) GetIssuesStageByOrgID added in v1.0.0

func (client *DBClient) GetIssuesStageByOrgID(orgID int64) ([]IssueStage, error)

GetIssuesStageByOrgID get issuesStage by orgID

func (*DBClient) GetIssuesStateRelations

func (client *DBClient) GetIssuesStateRelations(projectID uint64, issueType apistructs.IssueType) ([]IssueStateJoinSQL, error)

func (*DBClient) GetIssuesStatesByProjectID

func (client *DBClient) GetIssuesStatesByProjectID(projectID uint64, issueType apistructs.IssueType) ([]IssueState, error)

func (*DBClient) GetIssuesStatesByProjectIDList

func (client *DBClient) GetIssuesStatesByProjectIDList(projectIDList []uint64) ([]IssueState, error)

get all state by projectID list

func (*DBClient) GetIteration

func (client *DBClient) GetIteration(id uint64) (*Iteration, error)

GetIteration Iteration 详情

func (*DBClient) GetIterationByTitle

func (client *DBClient) GetIterationByTitle(projectID uint64, title string) (*Iteration, error)

GetIterationByTitle 根据 title 获取 Iteration 信息

func (*DBClient) GetJob

func (client *DBClient) GetJob(orgID string, taskID uint64) []model.Jobs

GetJob 获取job信息

func (*DBClient) GetJoinedAppNumByUserId

func (client *DBClient) GetJoinedAppNumByUserId(userID, orgID string) (int, error)

get joined apps num by user and org

func (*DBClient) GetJoinedProjectNumByUserID

func (client *DBClient) GetJoinedProjectNumByUserID(userID string, orgID string) (int, []string, error)

get projects by userID and orgID

func (*DBClient) GetLabel

func (client *DBClient) GetLabel(labelID int64) (*Label, error)

GetLabel 根据标签ID获取标签详情

func (*DBClient) GetLabelByName

func (client *DBClient) GetLabelByName(projectID uint64, name string) (*Label, error)

GetLabelByName 根据 name 获取标签详情

func (*DBClient) GetLabelRelationsByLabels

func (client *DBClient) GetLabelRelationsByLabels(refType apistructs.ProjectLabelType, labelIDs []uint64) ([]LabelRelation, error)

GetLabelRelationsByLabels 获取标签关联关系列表

func (*DBClient) GetLabelRelationsByRef

func (client *DBClient) GetLabelRelationsByRef(refType apistructs.ProjectLabelType, refID uint64) ([]LabelRelation, error)

GetLabelRelationsByRef 获取标签关联关系列表

func (*DBClient) GetLabels

func (client *DBClient) GetLabels(labelIDs []uint64) ([]Label, error)

GetLabels 根据 labelID 获取标签列表

func (*DBClient) GetLastCommentByTicket

func (client *DBClient) GetLastCommentByTicket(ticketID int64) (*model.Comment, error)

GetLastCommentByTicket 根据 ticketID 获取最新评论

func (*DBClient) GetLibReference

func (client *DBClient) GetLibReference(libReferenceID uint64) (*LibReference, error)

GetLibReference 库引用详情

func (*DBClient) GetMBox

func (client *DBClient) GetMBox(id int64, orgID int64, userID string) (*apistructs.MBox, error)

func (*DBClient) GetMBoxStats

func (client *DBClient) GetMBoxStats(orgID int64, userID string) (*apistructs.QueryMBoxStatsData, error)

func (*DBClient) GetManagerMemberCountByUserID

func (client *DBClient) GetManagerMemberCountByUserID(userIDs []string, scopeID int64,
	scopeType apistructs.ScopeType) (uint64, error)

GetManagerMemberCountByUserID 获取某个用户的企业/项目/应用管理员数量

func (*DBClient) GetManagerMembersCount

func (client *DBClient) GetManagerMembersCount(scopeID int64, scopeType apistructs.ScopeType) (uint64, error)

GetManagerMembersCount 根据scopeID获取企业/项目/应用管理员的数量,todo delete

func (*DBClient) GetMeberExtraByParentID

func (client *DBClient) GetMeberExtraByParentID(userIDs []string, scopeType apistructs.ScopeType, parentID int64) ([]model.MemberExtra, error)

GetMeberExtraByParentID 通过父scope获取成员extra

func (*DBClient) GetMeberRoleByParentID

func (client *DBClient) GetMeberRoleByParentID(userID string, scopeType apistructs.ScopeType, parentID int64) ([]model.MemberExtra, error)

GetMeberRoleByParentID 通过父scope获取成员extra

func (*DBClient) GetMemberByID

func (client *DBClient) GetMemberByID(memberID int64) (*model.Member, error)

GetMemberByID 根据memberID获取成员

func (*DBClient) GetMemberByIDs

func (client *DBClient) GetMemberByIDs(memberIDs []int64) ([]model.Member, error)

GetMemberByIDs 根据memberID列表获取成员列表

func (*DBClient) GetMemberByScopeAndRole

func (client *DBClient) GetMemberByScopeAndRole(scopeType apistructs.ScopeType, scopeIDs []uint64,
	roles []string) ([]model.MemberExtra, error)

GetMemberByScopeAndRole 根据Scope和角色获取成员

func (*DBClient) GetMemberByScopeAndUserID

func (client *DBClient) GetMemberByScopeAndUserID(userID string, scopeType apistructs.ScopeType,
	scopeID int64) ([]model.MemberJoin, error)

GetMemberByScopeAndUserID 根据scope & userID过滤

func (*DBClient) GetMemberByToken

func (client *DBClient) GetMemberByToken(token string) (*model.Member, error)

GetMemberByToken 根据token获取成员

func (*DBClient) GetMemberByUserID

func (client *DBClient) GetMemberByUserID(userID string) ([]model.Member, error)

GetMemberByUserID 通过 user_id 获取成员

func (*DBClient) GetMemberByUserIDAndScopeIDs

func (client *DBClient) GetMemberByUserIDAndScopeIDs(userID string, scopeType apistructs.ScopeType, scopeIDs []int64) ([]model.Member, error)

GetMemberByUserIDAndScopeIDs 通过 user_id 和 scopeIDs 信息获取成员

func (*DBClient) GetMemberByUserIDsAndScope

func (client *DBClient) GetMemberByUserIDsAndScope(userIDs []string, scopeType apistructs.ScopeType, scopeID int64) ([]model.Member, error)

GetMemberByUserIDsAndScope 通过 user_id 和 scope 信息获取成员

func (*DBClient) GetMemberExtra

func (client *DBClient) GetMemberExtra(userIDs []string, scopeType apistructs.ScopeType, scopeID int64,
	resourceKey []apistructs.ExtraResourceKey) ([]model.MemberExtra, error)

GetMemberExtra 根据UserID, Scope和resourceKey获取成员关联关系

func (*DBClient) GetMemberExtraByIDs

func (client *DBClient) GetMemberExtraByIDs(userIDs []string, scopeType apistructs.ScopeType, scopeIDs []int64,
	resourceKey []apistructs.ExtraResourceKey) ([]model.MemberExtra, error)

GetMemberExtraByIDs 根据多个userid和scopeid查询memberextra

func (*DBClient) GetMembersByOrgAndUser

func (client *DBClient) GetMembersByOrgAndUser(orgID int64, userID string) ([]model.MemberJoin, error)

GetMembersByOrgAndUser 根据userID查询成员

func (*DBClient) GetMembersByParam

func (client *DBClient) GetMembersByParam(param *apistructs.MemberListRequest) (
	int, []model.Member, error)

GetMembersByParam 根据查询参数获取企业成员列表

func (*DBClient) GetMembersByParentID

func (client *DBClient) GetMembersByParentID(scopeType apistructs.ScopeType, parentID int64, userID string) (
	[]model.MemberJoin, error)

GetMembersByParentID 根据parentID & userID等信息查询权限

func (*DBClient) GetMembersByScope

func (client *DBClient) GetMembersByScope(scopeType apistructs.ScopeType, scopeIDs []string, roles []string) ([]model.Member, error)

GetMembersByScope 查询指定scope和role的用户,todo delete

func (*DBClient) GetMembersByScopeType

func (client *DBClient) GetMembersByScopeType(scopeType apistructs.ScopeType) ([]model.Member, error)

GetMembersByScopeType 根据scopeType获取所有对应的成员列表,todo delete

func (*DBClient) GetMembersByScopeTypeAndUser

func (client *DBClient) GetMembersByScopeTypeAndUser(scopeType apistructs.ScopeType, userID string) ([]model.Member, error)

GetMembersByScopeTypeAndUser 根据scopeType & user获取成员

func (*DBClient) GetMembersWithoutExtraByScope

func (client *DBClient) GetMembersWithoutExtraByScope(scopeType apistructs.ScopeType, scopeID int64) (
	int, []model.Member, error)

GetMembersWithoutExtraByParentID 根据parentID 信息查询成员,不带角色label等信息

func (*DBClient) GetNamespaceByName

func (client *DBClient) GetNamespaceByName(name string) (*model.ConfigNamespace, error)

GetNamespaceByName 根据 name 获取 namespac

func (*DBClient) GetNamespaceRelationByName

func (client *DBClient) GetNamespaceRelationByName(name string) (*model.ConfigNamespaceRelation, error)

GetNamespaceRelationByName 根据 name 获取 namespace 关联关系

func (*DBClient) GetNamespaceRelationsByDefaultName

func (client *DBClient) GetNamespaceRelationsByDefaultName(name string) ([]model.ConfigNamespaceRelation, error)

GetNamespaceRelationByDefaultName 根据 defaultName 获取 namespace 关联关系

func (*DBClient) GetNamespacesByNames

func (client *DBClient) GetNamespacesByNames(names []string) ([]model.ConfigNamespace, error)

GetNamespacesByNames 根据 多个names 获取 多个namespace

func (*DBClient) GetNexusRepository

func (client *DBClient) GetNexusRepository(id uint64) (*NexusRepository, error)

func (*DBClient) GetNexusRepositoryByName

func (client *DBClient) GetNexusRepositoryByName(name string) (*NexusRepository, error)

func (*DBClient) GetNexusUser

func (client *DBClient) GetNexusUser(id uint64) (*NexusUser, error)

func (*DBClient) GetNexusUserByName

func (client *DBClient) GetNexusUserByName(name string) (*NexusUser, error)

func (*DBClient) GetNotice

func (client *DBClient) GetNotice(noticeID uint64) (*Notice, error)

func (*DBClient) GetNotifyByGroupID

func (client *DBClient) GetNotifyByGroupID(groupID int64) (*model.Notify, error)

func (*DBClient) GetNotifyDetail

func (client *DBClient) GetNotifyDetail(id int64, orgID int64) (*apistructs.NotifyDetail, error)

func (*DBClient) GetNotifyGroupByID

func (client *DBClient) GetNotifyGroupByID(id int64, orgID int64) (*apistructs.NotifyGroup, error)

GetNotifyGroupByID 获取通知组

func (*DBClient) GetNotifyGroupByIDWithoutOrgID

func (client *DBClient) GetNotifyGroupByIDWithoutOrgID(id int64) (*apistructs.NotifyGroup, error)

GetNotifyGroupByIDWithoutOrgID 直接通过ID获取通知组

func (*DBClient) GetNotifyGroupNameByID

func (client *DBClient) GetNotifyGroupNameByID(id int64, orgID int64) (*apistructs.NotifyGroup, error)

func (*DBClient) GetNotifyItemsByNotifyID

func (client *DBClient) GetNotifyItemsByNotifyID(notifyID int64) ([]*apistructs.NotifyItem, error)

func (*DBClient) GetNotifyItemsByNotifyIDAndItemName

func (client *DBClient) GetNotifyItemsByNotifyIDAndItemName(notifyID int64, itemName string) ([]*apistructs.NotifyItem, error)

func (*DBClient) GetNotifySourcesByNotifyID

func (client *DBClient) GetNotifySourcesByNotifyID(notifyID int64) ([]*apistructs.NotifySource, error)

func (*DBClient) GetOpenTicketByKey

func (client *DBClient) GetOpenTicketByKey(key string) (*model.Ticket, error)

GetOpenTicketByKey 获取open状态的工单

func (*DBClient) GetOperatorByTaskID

func (client *DBClient) GetOperatorByTaskID(taskID []int) ([]model.ReviewUser, error)

func (*DBClient) GetOrg

func (client *DBClient) GetOrg(orgID int64) (model.Org, error)

GetOrg 根据orgID获取企业信息

func (*DBClient) GetOrgByName

func (client *DBClient) GetOrgByName(orgName string) (*model.Org, error)

GetOrgByName 根据 orgName 获取企业信息

func (*DBClient) GetOrgByUserIDs

func (client *DBClient) GetOrgByUserIDs(userIDs []string) ([]model.Member, error)

GetOrgByUserIDs 根据用户id获取对应的企业

func (*DBClient) GetOrgClusterRelationByOrgAndCluster

func (client *DBClient) GetOrgClusterRelationByOrgAndCluster(orgID, clusterID int64) (*model.OrgClusterRelation, error)

GetOrgClusterRelationByOrgAndCluster 获取企业集群关系

func (*DBClient) GetOrgClusterRelationsByOrg

func (client *DBClient) GetOrgClusterRelationsByOrg(orgID int64) ([]model.OrgClusterRelation, error)

GetOrgClusterRelationsByOrg 根据 orgID 获取企业对应集群关系

func (*DBClient) GetOrgList

func (client *DBClient) GetOrgList() ([]model.Org, error)

GetOrgList 获取所有企业列表(仅供内部用户使用)

func (*DBClient) GetOrgPublishersCount

func (client *DBClient) GetOrgPublishersCount(orgID uint64) (int64, error)

GetPublishersByIDs 获取企业的Publisher个数

func (*DBClient) GetOrgsByIDsAndName

func (client *DBClient) GetOrgsByIDsAndName(orgIDs []int64, name string, pageNo, pageSize int) (
	int, []model.Org, error)

GetOrgsByIDsAndName 根据企业ID列表 & 企业名称获取企业列表

func (*DBClient) GetOrgsByParam

func (client *DBClient) GetOrgsByParam(name string, pageNum, pageSize int) (int, []model.Org, error)

GetOrgsByParam 获取企业列表

func (*DBClient) GetOrgsByUserID

func (client *DBClient) GetOrgsByUserID(userID string) ([]model.Org, error)

GetOrgsByUserID 根据userID获取企业列表

func (*DBClient) GetOwnerMemberCountByUserID

func (client *DBClient) GetOwnerMemberCountByUserID(userIDs []string, scopeID int64,
	scopeType apistructs.ScopeType) (uint64, error)

GetOwnerMembersCountByUserID 获取某个用户的项目/应用所有者的数量

func (*DBClient) GetOwnerMembersCount

func (client *DBClient) GetOwnerMembersCount(scopeID int64, scopeType apistructs.ScopeType) (uint64, error)

GetOwnerMembersCount 根据scopeID获取项目/应用所有者的数量

func (*DBClient) GetPanelByIssueID

func (client *DBClient) GetPanelByIssueID(issueID int64) (*IssuePanel, error)

查询事件所属的看板

func (*DBClient) GetPanelByPanelID

func (client *DBClient) GetPanelByPanelID(panelID int64) (*IssuePanel, error)

通过看板ID获取看板详情

func (*DBClient) GetPanelIssuesByPanel

func (client *DBClient) GetPanelIssuesByPanel(panelID int64, pageNo, pageSize uint64) ([]IssuePanel, uint64, error)

通过PanelID获取看板下的全部issue

func (*DBClient) GetPanelIssuesID

func (client *DBClient) GetPanelIssuesID(projectID uint64) ([]int64, error)

获取一个项目的一个看板中的事件ID

func (*DBClient) GetPanelIssuesIDByProjectID

func (client *DBClient) GetPanelIssuesIDByProjectID(projectID uint64) ([]IssuePanel, error)

获取一个项目的全部自定义看板中的事件ID

func (*DBClient) GetPanelsByProjectID

func (client *DBClient) GetPanelsByProjectID(projectID uint64) ([]IssuePanel, error)

获取项目下自定义看板的ID

func (*DBClient) GetPermissionList

func (client *DBClient) GetPermissionList(roles []string) ([]model.RolePermission, []model.RolePermission)

GetPermissionList 获取角色权限列表

func (*DBClient) GetProjectApplications

func (client *DBClient) GetProjectApplications(projectID int64) ([]model.Application, error)

GetProjectApplications 根据projectID获取所有应用列表

func (*DBClient) GetProjectByID

func (client *DBClient) GetProjectByID(projectID int64) (model.Project, error)

GetProjectByID 根据projectID获取项目信息

func (*DBClient) GetProjectByOrgAndName

func (client *DBClient) GetProjectByOrgAndName(orgID int64, name string) (*model.Project, error)

GetProjectByOrgAndName 根据orgID & 项目名称 获取项目

func (*DBClient) GetProjectIDListByStates

func (client *DBClient) GetProjectIDListByStates(req apistructs.IssuePagingRequest, projectIDList []uint64) (int, []model.Project, error)

get states by projectID list

func (*DBClient) GetProjectMembersByUser

func (client *DBClient) GetProjectMembersByUser(userID string) ([]model.MemberExtra, error)

GetProjectMembersByUser 根据userID查询项目权限,todo delete

func (*DBClient) GetProjectsByIDs

func (client *DBClient) GetProjectsByIDs(projectIDs []uint64, params *apistructs.ProjectListRequest) (
	int, []model.Project, error)

GetProjectsByIDs 根据projectIDs获取项目列表

func (*DBClient) GetProjectsByOrgIDAndName

func (client *DBClient) GetProjectsByOrgIDAndName(orgID int64, params *apistructs.ProjectListRequest) (
	int, []model.Project, error)

GetProjectsByOrgIDAndName 根据orgID与名称获取项目列表

func (*DBClient) GetPropertyRelationByID

func (client *DBClient) GetPropertyRelationByID(issueID int64) ([]IssuePropertyRelation, error)

func (*DBClient) GetPropertyRelationByIssueID

func (client *DBClient) GetPropertyRelationByIssueID(issueID int64, propertyID int64) (*IssuePropertyRelation, error)

func (*DBClient) GetPropertyRelationByPropertyID

func (client *DBClient) GetPropertyRelationByPropertyID(propertyID int64) (*IssuePropertyRelation, error)

func (*DBClient) GetPublicOrgsByParam

func (client *DBClient) GetPublicOrgsByParam(name string, pageNum, pageSize int) (int, []model.Org, error)

Get public orgs list

func (*DBClient) GetPublisherByID

func (client *DBClient) GetPublisherByID(publisherID int64) (model.Publisher, error)

GetPublisherByID 根据publisherID获取Publisher信息

func (*DBClient) GetPublisherByOrgAndName

func (client *DBClient) GetPublisherByOrgAndName(orgID int64, name string) (*model.Publisher, error)

GetPublisherByOrgAndName 根据orgID & Publisher名称 获取Publisher

func (*DBClient) GetPublisherByOrgID

func (client *DBClient) GetPublisherByOrgID(orgID int64) (*model.Publisher, error)

GetPublisherByOrgID 根据orgID 获取Publisher

func (*DBClient) GetPublishersByIDs

func (client *DBClient) GetPublishersByIDs(publisherIDs []int64, params *apistructs.PublisherListRequest) (
	int, []model.Publisher, error)

GetPublishersByIDs 根据publisherIDs获取Publisher列表

func (*DBClient) GetPublishersByOrgIDAndName

func (client *DBClient) GetPublishersByOrgIDAndName(orgID int64, params *apistructs.PublisherListRequest) (
	int, []model.Publisher, error)

GetPublishersByOrgIDAndName 根据orgID与名称获取Publisher列表

func (*DBClient) GetRelatedIssues

func (client *DBClient) GetRelatedIssues(issueID uint64) ([]uint64, error)

GetRelatedIssues 获取该事件被哪些事件关联了

func (*DBClient) GetRelatingIssues

func (client *DBClient) GetRelatingIssues(issueID uint64) ([]uint64, error)

GetRelatingIssues 获取该事件关联了哪些事件

func (*DBClient) GetReviewByTaskId

func (*DBClient) GetReviewsBySponsorId

func (client *DBClient) GetReviewsBySponsorId(param *apistructs.GetReviewsBySponsorIdRequest) (int, []model.ManualReview, error)

func (*DBClient) GetReviewsByUserId

func (client *DBClient) GetReviewsByUserId(param *apistructs.GetReviewsByUserIdRequest, tasks []int64) (int, []model.ManualReview, error)

func (*DBClient) GetRolePermission

func (client *DBClient) GetRolePermission(roles []string, permissionInfo *apistructs.PermissionCheckRequest) (*model.RolePermission, error)

GetRolePermission 获取角色权限

func (*DBClient) GetRunningAddonByClusterAndInstanceID

func (client *DBClient) GetRunningAddonByClusterAndInstanceID(clusterName, instanceID string) (*[]model.Container, error)

GetRunningAddonByClusterAndInstanceID 根据 clusterName & addon instanceID 获取运行中的addon containers

func (*DBClient) GetRunningComponentContainersByClusterAndComponent

func (client *DBClient) GetRunningComponentContainersByClusterAndComponent(clusterName, componentName string) ([]model.Container, error)

GetRunningComponentContainersByClusterAndComponent 根据 clusterName & component 获取集群内正在运行的平台组件容器

func (*DBClient) GetScopeManagersByScopeID

func (client *DBClient) GetScopeManagersByScopeID(scopeType apistructs.ScopeType, scopeID int64) ([]model.Member, error)

GetScopeManagersByScopeID 根据 scopeID 获取 scope 对应的管理员列表

func (*DBClient) GetScopeNameByScope

func (client *DBClient) GetScopeNameByScope(scopeType apistructs.ScopeType, scopeID int64) string

GetScopeNameByScope 根据scope获取名称

func (*DBClient) GetTaskIDByOperator

func (client *DBClient) GetTaskIDByOperator(param *apistructs.GetReviewsByUserIdRequest) ([]int64, error)

func (*DBClient) GetTicket

func (client *DBClient) GetTicket(ticketID int64) (*model.Ticket, error)

GetTicket 获取工单详情

func (*DBClient) GetTicketByRequestID

func (client *DBClient) GetTicketByRequestID(requestID string) (*model.Ticket, error)

GetTicketByRequestID 根据requestID header获取记录

func (*DBClient) InitOrgAuditInterval

func (client *DBClient) InitOrgAuditInterval(orgIDs []uint64) error

InitOrgAuditInterval 初始化企业的审计事件清理周期

func (*DBClient) InsertContainer

func (client *DBClient) InsertContainer(ctx context.Context, c *types.CmContainer) error

InsertContainer 新增 container 信息

func (*DBClient) IsSysAdmin

func (client *DBClient) IsSysAdmin(userID string) (bool, error)

IsSysAdmin 判断用户是否为系统管理员

func (*DBClient) IssueStateCount

func (client *DBClient) IssueStateCount(requirementIDs []int64) ([]apistructs.RequirementGroupResult, error)

IssueStateCount 需求下任务统计

func (*DBClient) IssueStateCount2

func (client *DBClient) IssueStateCount2(issueIDs []uint64) ([]apistructs.RequirementGroupResult, error)

IssueStateCount2 需求关联的任务状态统计

func (*DBClient) ListAllContainersByService

func (client *DBClient) ListAllContainersByService(runtimeID, serviceName string) ([]model.Container, error)

ListAllContainersByService 根据serviceName 获取所有实例列表(包含运行中、已停止)

func (*DBClient) ListAllOrgClusterRelations

func (client *DBClient) ListAllOrgClusterRelations() ([]model.OrgClusterRelation, error)

ListAllOrgClusterRelations 获取所有企业对应集群关系

func (*DBClient) ListCluster

func (client *DBClient) ListCluster() (*[]model.Cluster, error)

ListCluster 获取集群列表

func (*DBClient) ListClusterByIDs

func (client *DBClient) ListClusterByIDs(clusterIDs []uint64) (*[]model.Cluster, error)

ListClusterByIDs 根据集群ID列表获取集群信息

func (*DBClient) ListClusterByNames

func (client *DBClient) ListClusterByNames(clusterNames []string) (*[]model.Cluster, error)

ListClusterByNames 根据集群名称列表获取集群信息

func (*DBClient) ListClusterByOrg

func (client *DBClient) ListClusterByOrg(orgID int64) (*[]model.Cluster, error)

ListClusterByOrg 根据 orgID 获取集群信息

func (*DBClient) ListClusterByOrgAndType

func (client *DBClient) ListClusterByOrgAndType(orgID int64, clusterType string) (*[]model.Cluster, error)

ListClusterByOrgAndType 根据 orgID, type 获取集群信息

func (*DBClient) ListClusterRunningContainers

func (client *DBClient) ListClusterRunningContainers(clusterName string) ([]model.Container, error)

ListClusterRunningContainers 根据clusterName 获取集群运行中实例列表

func (*DBClient) ListContainerByApplication

func (client *DBClient) ListContainerByApplication(appID, orgID string, running bool) ([]model.Container, error)

ListContainerByApplication 根据 appID 获取容器列表

func (*DBClient) ListContainerByCluster

func (client *DBClient) ListContainerByCluster(clusterName, orgID string, running bool) ([]model.Container, error)

ListContainerByCluster 根据 clusterName 获取容器列表

func (*DBClient) ListContainerByHost

func (client *DBClient) ListContainerByHost(clusterName, hostIP string, running bool) ([]model.Container, error)

ListContainerByHost 根据 clusterName & hostIP 获取容器列表

func (*DBClient) ListContainerByOrg

func (client *DBClient) ListContainerByOrg(orgID string, running bool) ([]model.Container, error)

ListByOrg 根据 orgID 获取容器列表

func (*DBClient) ListContainerByProject

func (client *DBClient) ListContainerByProject(projectID, orgID string, running bool) ([]model.Container, error)

ListContainerByProject 根据 projectID 获取容器列表

func (*DBClient) ListContainerByRuntime

func (client *DBClient) ListContainerByRuntime(runtimeID, orgID string, running bool) ([]model.Container, error)

ListContainerByRuntime 根据 runtimeID 获取容器列表

func (*DBClient) ListDeploymentsByOrgID

func (client *DBClient) ListDeploymentsByOrgID(param *apistructs.OrgRunningTasksListRequest,
	orgID uint64) (int64, *[]model.Deployments, error)

ListDeploymentsByOrgID 获取指定企业的部署列表

func (*DBClient) ListEdasContainerByParam

func (client *DBClient) ListEdasContainerByParam(params *apistructs.EdasContainerListRequest) ([]model.Container, error)

ListEdasContainerByParam 根据 params 过滤出 EDAS 容器列表

func (*DBClient) ListErrorLogByResources

func (client *DBClient) ListErrorLogByResources(resourceTypes []apistructs.ErrorResourceType, resourceIDs []string) ([]model.ErrorLog, error)

ListErrorLogByResources 根据多个resource信息查看错误日志

func (*DBClient) ListErrorLogByResourcesAndStartTime

func (client *DBClient) ListErrorLogByResourcesAndStartTime(resourceTypes []apistructs.ErrorResourceType,
	resourceIDs []string, startTime time.Time) ([]model.ErrorLog, error)

ListErrorLogByResourcesAndStartTime 根据多个resource信息和开始时间查看错误日志

func (*DBClient) ListExpiredDeployments

func (client *DBClient) ListExpiredDeployments(startTime string) []model.Deployments

ListExpiredDeployments 列出过期的deployment

func (*DBClient) ListExpiredFiles

func (client *DBClient) ListExpiredFiles(expiredAt time.Time) ([]File, error)

func (*DBClient) ListExpiredJobs

func (client *DBClient) ListExpiredJobs(startTime string) []model.Jobs

ListExpiredJobs 列出过期的job

func (*DBClient) ListIssue

func (client *DBClient) ListIssue(req apistructs.IssueListRequest) ([]Issue, error)

ListIssue 查询事件列表

func (*DBClient) ListIssueByIDs

func (client *DBClient) ListIssueByIDs(issueIDs []int64) ([]Issue, error)

func (*DBClient) ListIssueTestCaseRelations

func (client *DBClient) ListIssueTestCaseRelations(req apistructs.IssueTestCaseRelationsListRequest) ([]IssueTestCaseRelation, error)

ListIssueTestCaseRelations 查询事件用例关联关系列表

func (*DBClient) ListJobsByOrgID

func (client *DBClient) ListJobsByOrgID(param *apistructs.OrgRunningTasksListRequest,
	orgID uint64) (int64, *[]model.Jobs, error)

ListJobsByOrgID 获取指定企业的job列表

func (*DBClient) ListLabel

func (client *DBClient) ListLabel(req *apistructs.ProjectLabelListRequest) (int64, []Label, error)

ListLabel 获取标签列表

func (*DBClient) ListLabelByNames

func (client *DBClient) ListLabelByNames(projectID uint64, names []string) ([]Label, error)

ListLabelByNames 根据 name 列表获取标签列表

func (*DBClient) ListLibReference

func (client *DBClient) ListLibReference(req *apistructs.LibReferenceListRequest) (uint64, []LibReference, error)

ListLibReference 库引用列表

func (*DBClient) ListNamespaceByAppID

func (client *DBClient) ListNamespaceByAppID(name string) ([]model.ConfigNamespace, error)

ListNamespaceByAppID 修复数据库老数据使用 name = app-2079

func (*DBClient) ListNexusRepositories

func (client *DBClient) ListNexusRepositories(req apistructs.NexusRepositoryListRequest) ([]*NexusRepository, error)

func (*DBClient) ListNexusUsers

func (client *DBClient) ListNexusUsers(req apistructs.NexusUserListRequest) ([]NexusUser, error)

func (*DBClient) ListNotice

func (client *DBClient) ListNotice(req *apistructs.NoticeListRequest) (uint64, []Notice, error)

ListNotice 公告列表

func (*DBClient) ListProjectByCluster

func (client *DBClient) ListProjectByCluster(clusterName string) ([]model.Project, error)

ListProjectByCluster 根据clusterName 获取项目列表

func (*DBClient) ListProjectByOrgID

func (client *DBClient) ListProjectByOrgID(orgID uint64) ([]model.Project, error)

ListProjectByOrgID 根据 orgID 获取项目列表

func (*DBClient) ListRunningAddonsByCluster

func (client *DBClient) ListRunningAddonsByCluster(clusterName string) ([]model.Container, error)

ListRunningAddonsByCluster 根据 clusterName 获取集群中正在运行的 addon containers

func (*DBClient) ListRunningComponentContainerByCluster

func (client *DBClient) ListRunningComponentContainerByCluster(clusterName string) ([]model.Container, error)

ListRunningComponentContainerByCluster 根据 clusterName 获取集群内正在运行的平台组件容器

func (*DBClient) ListRunningContainersByHost

func (client *DBClient) ListRunningContainersByHost(clusterName, hostIP string) ([]model.Container, error)

ListRunningContainersByHost 根据 cluster & hostIP 获取运行中容器列表

func (*DBClient) ListRunningContainersByService

func (client *DBClient) ListRunningContainersByService(runtimeID, serviceName string) ([]model.Container, error)

ListRunningByService 根据serviceName 获取运行中实例列表

func (*DBClient) ListRunningDeployments

func (client *DBClient) ListRunningDeployments() []model.Deployments

ListRunningDeployments 列出正在运行的deployment

func (*DBClient) ListRunningJobs

func (client *DBClient) ListRunningJobs() []model.Jobs

ListRunningJobs 列出正在运行的job

func (*DBClient) ListRunningProjectContainersByCluster

func (client *DBClient) ListRunningProjectContainersByCluster(clusterName, orgID string) ([]model.Container, error)

ListRunningProjectContainersByCluster 根据 clusterName 获取集群内正在运行的 containers

func (*DBClient) ListStoppedContainersByService

func (client *DBClient) ListStoppedContainersByService(runtimeID, serviceName string) ([]model.Container, error)

ListStoppedByService 根据serviceName 获取已停止实例列表

func (*DBClient) ListUnblockApplicationApprove

func (client *DBClient) ListUnblockApplicationApprove(orgID uint64) ([]model.Approve, error)

func (*DBClient) PageMeberRoleByParentID

func (client *DBClient) PageMeberRoleByParentID(req apistructs.ListMemberRolesByUserRequest) (int, []model.Member, error)

PageMeberRoleByParentID 通过用户和父scope分页查询成员角色

func (*DBClient) PagingIssueStream

func (client *DBClient) PagingIssueStream(req *apistructs.IssueStreamPagingRequest) (int64, []IssueStream, error)

PagingIssueStream issue 分页查询事件流

func (*DBClient) PagingIssues

func (client *DBClient) PagingIssues(req apistructs.IssuePagingRequest, queryIDs bool) ([]Issue, uint64, error)

PagingIssues 分页查询issue queryIDs = true 表示不管req.IDs是否为空都要根据ID查询

func (*DBClient) PagingIterations

func (client *DBClient) PagingIterations(req apistructs.IterationPagingRequest) ([]Iteration, uint64, error)

Iteration 分页查询

func (*DBClient) PagingPropertyRelationByIDs

func (client *DBClient) PagingPropertyRelationByIDs(issueID []int64) ([]IssuePropertyRelation, error)

func (*DBClient) QueryAppPublishItemRelations

func (client *DBClient) QueryAppPublishItemRelations(req apistructs.QueryAppPublishItemRelationRequest) ([]apistructs.AppPublishItemRelation, error)

func (*DBClient) QueryBranchRules

func (client *DBClient) QueryBranchRules(scopeType apistructs.ScopeType, scopeID int64) ([]model.BranchRule, error)

QueryBranchRules 查询分支列表

func (*DBClient) QueryBranchRulesByScope

func (client *DBClient) QueryBranchRulesByScope(scopeType apistructs.ScopeType) ([]model.BranchRule, error)

func (*DBClient) QueryContainer

func (client *DBClient) QueryContainer(ctx context.Context, cluster string, id string) (*types.CmContainer, error)

QueryContainer 获取单个容器信息

func (*DBClient) QueryContainerByTaskIDOrContainerID

func (client *DBClient) QueryContainerByTaskIDOrContainerID(ctx context.Context, cluster string, taskID string,
	containerID string) ([]types.CmContainer, error)

QueryContainerByTaskIDOrContainerID 根据 taskID 或者 containerID 查询 container 信息

func (*DBClient) QueryHost

func (client *DBClient) QueryHost(ctx context.Context, cluster, addr string) (*types.CmHost, error)

QueryHost 获取单个host的信息

func (*DBClient) QueryMBox

func (client *DBClient) QueryMBox(request *apistructs.QueryMBoxRequest) (*apistructs.QueryMBoxData, error)

func (*DBClient) QueryNotifies

func (client *DBClient) QueryNotifies(request *apistructs.QueryNotifyRequest) (*apistructs.QueryNotifyData, error)

func (*DBClient) QueryNotifiesBySource

func (client *DBClient) QueryNotifiesBySource(sourceType, sourceID, itemName string, orgID int64, clusterName string, label string) ([]*apistructs.NotifyDetail, error)

func (*DBClient) QueryNotifyGroup

func (client *DBClient) QueryNotifyGroup(request *apistructs.QueryNotifyGroupRequest, orgID int64) (*apistructs.QueryNotifyGroupData, error)

QueryNotifyGroup 查询通知组

func (*DBClient) QueryNotifyHistories

func (client *DBClient) QueryNotifyHistories(request *apistructs.QueryNotifyHistoryRequest) (*apistructs.QueryNotifyHistoryData, error)

func (*DBClient) QueryNotifyItems

func (client *DBClient) QueryNotifyItems(request *apistructs.QueryNotifyItemRequest) (*apistructs.QueryNotifyItemData, error)

func (*DBClient) QuerytNotifyItemsByNotifyIDAndItemName

func (client *DBClient) QuerytNotifyItemsByNotifyIDAndItemName(notifyID int64, itemName string) ([]*apistructs.NotifyItem, error)

func (*DBClient) QuoteCertificate

func (client *DBClient) QuoteCertificate(certificate *model.AppCertificate) error

QuoteCertificate 创建应用Certificate

func (*DBClient) RemovePublishItemRelations

func (client *DBClient) RemovePublishItemRelations(request *apistructs.RemoveAppPublishItemRelationsRequest) error

func (*DBClient) SetMBoxReadStatus

func (client *DBClient) SetMBoxReadStatus(request *apistructs.SetMBoxReadStatusRequest) error

func (*DBClient) SoftDeleteEnvConfig

func (client *DBClient) SoftDeleteEnvConfig(config *model.ConfigItem) error

UpdateEnvConfig 更新环境变量配置

func (*DBClient) SoftDeleteNamespace

func (client *DBClient) SoftDeleteNamespace(namespace *model.ConfigNamespace) error

SoftDeleteNamespace 软删除 namespace

func (*DBClient) SoftDeleteNamespaceRelation

func (client *DBClient) SoftDeleteNamespaceRelation(namespaceRelation *model.ConfigNamespaceRelation) error

SoftDeleteNamespace 软删除 namespace

func (*DBClient) UpdateAccount

func (client *DBClient) UpdateAccount(account *model.CloudAccount) error

UpdateCloudAccount 更新云账号

func (*DBClient) UpdateAppPublishItemRelations

func (client *DBClient) UpdateAppPublishItemRelations(request *apistructs.UpdateAppPublishItemRelationRequest) error

func (*DBClient) UpdateApplication

func (client *DBClient) UpdateApplication(application *model.Application) error

UpdateApplication 更新应用

func (*DBClient) UpdateApproval

func (client *DBClient) UpdateApproval(param *apistructs.UpdateApproval) error

func (*DBClient) UpdateApprovalStatusByApprovalID

func (client *DBClient) UpdateApprovalStatusByApprovalID(approvalID uint64, status apistructs.ApprovalStatus) error

UpdateApprovalStatusByApprovalID 更新审批流状态

func (*DBClient) UpdateApprove

func (client *DBClient) UpdateApprove(approve *model.Approve) error

UpdateApprove 更新Approve

func (*DBClient) UpdateAuditCleanCron

func (client *DBClient) UpdateAuditCleanCron(orgID, interval int64) error

UpdateAuditCleanCron 修改企业事件清理周期

func (*DBClient) UpdateBranchRule

func (client *DBClient) UpdateBranchRule(branchRule *model.BranchRule) error

UpdateBranchRule 更新分支规则

func (*DBClient) UpdateCertificate

func (client *DBClient) UpdateCertificate(certificate *model.Certificate) error

UpdateCertificate 更新Certificate

func (*DBClient) UpdateCluster

func (client *DBClient) UpdateCluster(cluster *model.Cluster) error

UpdateCluster 更新集群

func (*DBClient) UpdateComment

func (client *DBClient) UpdateComment(comment *model.Comment) error

UpdateComment 更新工单评论

func (*DBClient) UpdateContainer

func (client *DBClient) UpdateContainer(container *model.Container) error

UpdateContainer 更新容器

func (*DBClient) UpdateContainerByPrimaryKeyID

func (client *DBClient) UpdateContainerByPrimaryKeyID(ctx context.Context, c *types.CmContainer) error

TODO 以下皆须重构 UpdateContainerByPrimaryKeyID 根据主键进行更新

func (*DBClient) UpdateContainerByTaskIDOrContainerID

func (client *DBClient) UpdateContainerByTaskIDOrContainerID(ctx context.Context, c *types.CmContainer) error

UpdateContainerByTaskIDOrContainerID 根据 taskID 或者 contianerID 来更新 container 信息

func (*DBClient) UpdateCurrentOrg

func (client *DBClient) UpdateCurrentOrg(userID string, orgID int64) error

UpdateCurrentOrg 更新用户当前所属企业

func (*DBClient) UpdateDeploymentStatus

func (client *DBClient) UpdateDeploymentStatus(deployment *model.Deployments) error

UpdateDeploymentStatus 更新deployment状态

func (*DBClient) UpdateErrorLog

func (client *DBClient) UpdateErrorLog(errorLog *model.ErrorLog) error

UpdateErrorLog 更新错误日志记录

func (*DBClient) UpdateHost

func (client *DBClient) UpdateHost(host *model.Host) error

UpdateHost 更新host

func (*DBClient) UpdateIssue

func (client *DBClient) UpdateIssue(id uint64, fields map[string]interface{}) error

Issue 更新

func (*DBClient) UpdateIssuePropertiesIndex

func (client *DBClient) UpdateIssuePropertiesIndex(properties []IssueProperty) error

func (*DBClient) UpdateIssueProperty

func (client *DBClient) UpdateIssueProperty(property *IssueProperty) error

func (*DBClient) UpdateIssuePropertyValue

func (client *DBClient) UpdateIssuePropertyValue(property *IssuePropertyValue) error

func (*DBClient) UpdateIssueState

func (client *DBClient) UpdateIssueState(state *IssueState) error

func (*DBClient) UpdateIssueStateRelations

func (client *DBClient) UpdateIssueStateRelations(projectID int64, issueType apistructs.IssueType, StateRelations []IssueStateRelation) error

func (*DBClient) UpdateIssueStream

func (client *DBClient) UpdateIssueStream(is *IssueStream) error

UpdateIssueStream 更新 issue 事件流

func (*DBClient) UpdateIssueType

func (client *DBClient) UpdateIssueType(issue *Issue) error

UpdateIssueType 转换issueType

func (*DBClient) UpdateIssues

func (client *DBClient) UpdateIssues(requirementID uint64, fields map[string]interface{}) error

UpdateIssues 批量更新 issue

func (*DBClient) UpdateIssuesStateBelong

func (client *DBClient) UpdateIssuesStateBelong(id int64, belong apistructs.IssueStateBelong) error

func (*DBClient) UpdateIssuesStateIndex

func (client *DBClient) UpdateIssuesStateIndex(id int64, index int64) error

func (*DBClient) UpdateIteration

func (client *DBClient) UpdateIteration(Iteration *Iteration) error

Iteration 更新

func (*DBClient) UpdateJobStatus

func (client *DBClient) UpdateJobStatus(Job *model.Jobs) error

UpdateJobStatus 更新Job状态

func (*DBClient) UpdateLabel

func (client *DBClient) UpdateLabel(label *Label) error

UpdateLabel 更新 label

func (*DBClient) UpdateMember

func (client *DBClient) UpdateMember(member *model.Member) error

UpdateMember 更新成员

func (*DBClient) UpdateMemberUserInfo

func (client *DBClient) UpdateMemberUserInfo(ids []int64, fields map[string]interface{}) error

UpdateMemberUserInfo 更新成员 userinfo 信息

func (*DBClient) UpdateNotice

func (client *DBClient) UpdateNotice(notice *Notice) error

UpdateNotice 编辑公告

func (*DBClient) UpdateNotify

func (client *DBClient) UpdateNotify(request *apistructs.UpdateNotifyRequest) error

func (*DBClient) UpdateNotifyEnable

func (client *DBClient) UpdateNotifyEnable(id int64, enabled bool, orgID int64) error

func (*DBClient) UpdateNotifyGroup

func (client *DBClient) UpdateNotifyGroup(request *apistructs.UpdateNotifyGroupRequest) error

UpdateNotifyGroup 更新通知组

func (*DBClient) UpdateNotifyItem

func (client *DBClient) UpdateNotifyItem(request *apistructs.UpdateNotifyItemRequest) error

func (*DBClient) UpdateOrAddEnvConfig

func (client *DBClient) UpdateOrAddEnvConfig(config *model.ConfigItem) error

UpdateOrAddEnvConfig 更新环境变量配置

func (*DBClient) UpdateOrAddNamespace

func (client *DBClient) UpdateOrAddNamespace(namespace *model.ConfigNamespace) error

UpdateOrAddNamespace 更新/添加 namespace

func (*DBClient) UpdateOrAddNamespaceRelation

func (client *DBClient) UpdateOrAddNamespaceRelation(namespaceRelation *model.ConfigNamespaceRelation) error

UpdateOrAddNamespaceRelation 更新/添加命名空间关联关系

func (*DBClient) UpdateOrg

func (client *DBClient) UpdateOrg(org *model.Org) error

UpdateOrg 更新企业元信息,不可更改企业名称

func (*DBClient) UpdatePanel

func (client *DBClient) UpdatePanel(panel *IssuePanel) error

func (*DBClient) UpdateProject

func (client *DBClient) UpdateProject(project *model.Project) error

UpdateProject 更新项目

func (*DBClient) UpdateProjectQuota

func (client *DBClient) UpdateProjectQuota(clusterName string, cpuOverSellChangeRatio float64) error

UpdateProjectQuota 更新项目配额

func (*DBClient) UpdatePropertyRelationArbitraryValue

func (client *DBClient) UpdatePropertyRelationArbitraryValue(issueID int64, propertyID int64, value string) error

func (*DBClient) UpdatePublisher

func (client *DBClient) UpdatePublisher(publisher *model.Publisher) error

UpdatePublisher 更新Publisher

func (*DBClient) UpdateQuoteCertificate

func (client *DBClient) UpdateQuoteCertificate(certificate *model.AppCertificate) error

UpdateCertificate 更新Certificate

func (*DBClient) UpdateTicket

func (client *DBClient) UpdateTicket(ticket *model.Ticket) error

UpdateTicket 更新工单

type File

type File struct {
	BaseModel
	UUID             string       // UUID,解决重名问题;用自增 id 在存储介质上容易冲突
	DisplayName      string       // 文件名,用于下载的时候展示
	Ext              string       // 文件后缀,带 dot
	ByteSize         int64        // 文件大小,Byte
	StorageType      storage.Type // 存储类型
	FullRelativePath string       // 文件相对路径,不包含 网盘挂载点 或 oss bucket
	From             string       // 文件来源,例如 issue / gittar mr
	Creator          string       // 文件创建者 ID
	Extra            FileExtra    // 额外信息,包括存储介质关键信息快照等
	ExpiredAt        *time.Time   // 文件超时自动删除
}

File

func (File) TableName

func (File) TableName() string

type FileExtra

type FileExtra struct {
	OSSSnapshot OSSSnapshot `json:"ossSnapshot,omitempty"`
	IsPublic    bool        `json:"isPublic,omitempty"`

	Encrypt             bool   `json:"encrypt,omitempty"`
	KMSKeyID            string `json:"kmsKeyID,omitempty"`
	DEKCiphertextBase64 string `json:"dekCiphertextBase64,omitempty"`
}

func (*FileExtra) Scan

func (ex *FileExtra) Scan(value interface{}) error

func (FileExtra) Value

func (ex FileExtra) Value() (driver.Value, error)

type Int64Slice

type Int64Slice []int64

自定义 interface{},用于实现 []int64 的排序

func SortInt64Map

func SortInt64Map(m map[int64]int64) Int64Slice

func (Int64Slice) Len

func (c Int64Slice) Len() int

func (Int64Slice) Less

func (c Int64Slice) Less(i, j int) bool

func (Int64Slice) Swap

func (c Int64Slice) Swap(i, j int)

type Issue

type Issue struct {
	BaseModel
	PlanStartedAt  *time.Time                 // 计划开始时间
	PlanFinishedAt *time.Time                 // 计划结束时间
	ProjectID      uint64                     // 所属项目 ID
	IterationID    int64                      // 所属迭代 ID
	AppID          *uint64                    // 所属应用 ID
	RequirementID  *int64                     // 所属需求 ID
	Type           apistructs.IssueType       // issue 类型
	Title          string                     // 标题
	Content        string                     // 内容
	State          int64                      // 状态
	Priority       apistructs.IssuePriority   // 优先级
	Complexity     apistructs.IssueComplexity // 复杂度
	Severity       apistructs.IssueSeverity   // 严重程度
	Creator        string                     // issue 创建者 ID
	Assignee       string                     // 分配到 issue 的人,即当前处理人
	Source         string                     // issue创建的来源,目前只有工单使用
	ManHour        string                     // 工时信息
	External       bool                       // 用来区分是通过ui还是bundle创建的
	Deleted        bool                       // 是否已删除
	Stage          string                     // bug阶段 or 任务类型 的值
	Owner          string                     // 负责人

	FinishTime *time.Time // 实际结束时间
}

Issue

func (*Issue) GetCanUpdateFields

func (i *Issue) GetCanUpdateFields() map[string]interface{}

GetCanUpdateFields 获取所有可以被主动更新的字段

func (Issue) TableName

func (Issue) TableName() string

type IssueAppRelation

type IssueAppRelation struct {
	BaseModel
	IssueID   int64
	CommentID int64
	AppID     int64
	MRID      int64
}

IssueAppRelation 事件应用关联

func (IssueAppRelation) TableName

func (IssueAppRelation) TableName() string

TableName 表名

type IssuePanel

type IssuePanel struct {
	BaseModel
	ProjectID uint64 `gorm:"column:project_id"`
	IssueID   int64  `gorm:"column:issue_id"`
	PanelName string `gorm:"column:panel_name"`
	Relation  int64  `gorm:"column:relation"`
}

func (IssuePanel) TableName

func (IssuePanel) TableName() string

type IssueProperty

type IssueProperty struct {
	BaseModel
	ScopeType         apistructs.ScopeType         `gorm:"column:scope_type"`          // 系统管理员(sys)/企业(org)/项目(project)/应用(app)
	ScopeID           int64                        `gorm:"column:scope_id"`            // 企业ID/项目ID/应用ID
	OrgID             int64                        `gorm:"column:org_id"`              // 冗余 OrgID,方便删除企业时删除所有相关issue
	Required          bool                         `gorm:"column:required"`            // 是否是必填项
	PropertyType      apistructs.PropertyType      `gorm:"column:property_type"`       // 属性的的类型(单选,多选,文本)
	PropertyName      string                       `gorm:"column:property_name"`       // 属性的名称
	DisplayName       string                       `gorm:"column:display_name"`        // 属性的展示名称
	PropertyIssueType apistructs.PropertyIssueType `gorm:"column:property_issue_type"` // 事件类型
	Relation          int64                        `gorm:"column:relation"`            // 关联公用事件
	Index             int64                        `gorm:"column:index"`               // 字段排序级
}

IssueProperty 事件属性表

func (IssueProperty) TableName

func (IssueProperty) TableName() string

type IssuePropertyRelation

type IssuePropertyRelation struct {
	BaseModel
	OrgID           int64  `gorm:"column:org_id"` // 冗余 OrgID,方便删除企业时删除所有相关issue
	ProjectID       int64  `gorm:"column:project_id"`
	IssueID         int64  `gorm:"column:issue_id"`          // 事件ID
	PropertyID      int64  `gorm:"column:property_id"`       // 字段ID
	PropertyValueID int64  `gorm:"column:property_value_id"` // 枚举值ID
	ArbitraryValue  string `gorm:"column:arbitrary_value"`   // 字段自定义输入值
}

IssuePropertyRelation 事件属性实例关联表

func (IssuePropertyRelation) TableName

func (IssuePropertyRelation) TableName() string

type IssuePropertyValue

type IssuePropertyValue struct {
	BaseModel
	PropertyID int64  `gorm:"column:property_id"`
	Value      string `gorm:"column:value"`
	Name       string `gorm:"column:name"`
}

IssuePropertyValue 事件属性值表

func (IssuePropertyValue) TableName

func (IssuePropertyValue) TableName() string

type IssueRelation

type IssueRelation struct {
	BaseModel
	IssueID      uint64
	RelatedIssue uint64
	Comment      string
}

IssueRelation 事件事件关联

func (IssueRelation) TableName

func (IssueRelation) TableName() string

TableName 表名

type IssueStage

type IssueStage struct {
	BaseModel
	OrgID     int64                `gorm:"column:org_id"`
	IssueType apistructs.IssueType `gorm:"column:issue_type"`
	Name      string               `gorm:"column:name"`
	Value     string               `gorm:"column:value"`
}

func (IssueStage) TableName

func (i IssueStage) TableName() string

type IssueState

type IssueState struct {
	BaseModel
	ProjectID uint64                      `gorm:"column:project_id"`
	IssueType apistructs.IssueType        `gorm:"column:issue_type"`
	Name      string                      `gorm:"column:name"`
	Belong    apistructs.IssueStateBelong `gorm:"column:belong"`
	Index     int64                       `gorm:"column:index"`
	Role      string                      `gorm:"column:role"`
}

func (IssueState) TableName

func (IssueState) TableName() string

type IssueStateJoinSQL

type IssueStateJoinSQL struct {
	ID         int64                       `gorm:"primary_key"`
	ProjectID  uint64                      `gorm:"column:project_id"`
	IssueType  apistructs.IssueType        `gorm:"column:issue_type"`
	Name       string                      `gorm:"column:name"`
	Belong     apistructs.IssueStateBelong `gorm:"column:belong"`
	Index      int64                       `gorm:"column:index"`
	EndStateID int64                       `gorm:"column:end_state_id"`
}

type IssueStateRelation

type IssueStateRelation struct {
	BaseModel
	ProjectID    int64                `gorm:"column:project_id"`
	IssueType    apistructs.IssueType `gorm:"column:issue_type"`
	StartStateID int64                `gorm:"column:start_state_id"`
	EndStateID   int64                `gorm:"column:end_state_id"`
}

func (IssueStateRelation) TableName

func (IssueStateRelation) TableName() string

type IssueStream

type IssueStream struct {
	model.BaseModel
	IssueID      int64                      // issue id
	Operator     string                     // 操作人
	StreamType   apistructs.IssueStreamType // 通过事件流类型找到对应模板
	StreamParams apistructs.ISTParam        // 事件流模板值, 参数取值范围见: apistructs.ISTParam
}

IssueStream 事件流水表

func (*IssueStream) Convert

func (stream *IssueStream) Convert(content string) apistructs.IssueStream

Convert 事件流格式转换

func (IssueStream) TableName

func (IssueStream) TableName() string

TableName 表名

type IssueTestCaseRelation

type IssueTestCaseRelation struct {
	BaseModel
	IssueID           uint64 `json:"issueID"`
	TestPlanID        uint64 `json:"testPlanID"`
	TestPlanCaseRelID uint64 `json:"testPlanCaseRelID"`
	TestCaseID        uint64 `json:"testCaseID"`
	CreatorID         string `json:"creatorID"`
}

IssueTestCaseRelation 事件与用例关联

func (IssueTestCaseRelation) TableName

func (IssueTestCaseRelation) TableName() string

TableName 表名

type Iteration

type Iteration struct {
	BaseModel
	StartedAt  *time.Time                // 迭代开始时间
	FinishedAt *time.Time                // 迭代结束时间
	ProjectID  uint64                    // 所属项目 ID
	Title      string                    // 标题
	Content    string                    // 内容
	Creator    string                    // 创建者 ID
	State      apistructs.IterationState // 归档状态
}

func (*Iteration) Convert

func (i *Iteration) Convert() apistructs.Iteration

func (Iteration) TableName

func (Iteration) TableName() string

type Label

type Label struct {
	BaseModel
	Name      string                      // 标签名称
	Type      apistructs.ProjectLabelType // 标签作用类型
	Color     string                      // 标签颜色
	ProjectID uint64                      // 标签所属项目
	Creator   string                      // 创建人
}

Label 标签

func (Label) TableName

func (Label) TableName() string

TableName 表名

type LabelRelation

type LabelRelation struct {
	BaseModel
	LabelID uint64                      `json:"label_id"` // 标签 id
	RefType apistructs.ProjectLabelType `json:"ref_type"` // 标签作用类型, eg: issue
	RefID   uint64                      `json:"ref_id"`   // 标签关联目标 id
}

LabelRelation 标签关联关系

func (LabelRelation) TableName

func (LabelRelation) TableName() string

TableName 表名

type LibReference

type LibReference struct {
	BaseModel
	AppID          uint64
	LibID          uint64
	LibName        string
	LibDesc        string
	ApprovalID     uint64
	ApprovalStatus apistructs.ApprovalStatus
	Creator        string
}

LibReference 库引用

func (LibReference) TableName

func (LibReference) TableName() string

TableName 表名

type NexusRepository

type NexusRepository struct {
	BaseModel

	OrgID       *uint64 `json:"orgID"`       // 所属 org ID
	PublisherID *uint64 `json:"publisherID"` // 所属 publisher ID
	ClusterName string  `json:"clusterName"` // 所属集群

	Name   string                 `json:"name"`   // unique name
	Format nexus.RepositoryFormat `json:"format"` // maven2 / npm / ...
	Type   nexus.RepositoryType   `json:"type"`   // group / proxy / hosted
	Config NexusRepositoryConfig  `json:"config"` // repo config
}

func (NexusRepository) TableName

func (NexusRepository) TableName() string

type NexusRepositoryConfig

type NexusRepositoryConfig nexus.Repository

func (*NexusRepositoryConfig) Scan

func (config *NexusRepositoryConfig) Scan(value interface{}) error

func (NexusRepositoryConfig) Value

func (config NexusRepositoryConfig) Value() (driver.Value, error)

type NexusUser

type NexusUser struct {
	BaseModel

	RepoID      *uint64 `json:"repoID"`      // 所属 repo,可以为空
	PublisherID *uint64 `json:"publisherID"` // 所属 publisher,可以为空
	OrgID       *uint64 `json:"orgID"`       // 所属 org,可以为空
	ClusterName string  `json:"clusterName"` // 所属集群

	Name     string          `json:"name"`
	Password string          `json:"password"` // 加密存储
	Config   NexusUserConfig `json:"config"`
}

func (NexusUser) TableName

func (NexusUser) TableName() string

type NexusUserConfig

type NexusUserConfig nexus.User

func (*NexusUserConfig) Scan

func (config *NexusUserConfig) Scan(value interface{}) error

func (NexusUserConfig) Value

func (config NexusUserConfig) Value() (driver.Value, error)

type Notice

type Notice struct {
	BaseModel
	OrgID   uint64
	Content string
	Status  apistructs.NoticeStatus
	Creator string
}

Notice 平台公告

func (Notice) TableName

func (Notice) TableName() string

TableName 表名

type OSSSnapshot

type OSSSnapshot struct {
	OSSEndpoint string `json:"ossEndpoint,omitempty"`
	OSSBucket   string `json:"ossBucket,omitempty"`
}

type ProjectID

type ProjectID struct {
	ProjectID string `json:"project_id"`
}

Jump to

Keyboard shortcuts

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