Documentation ¶
Index ¶
- Constants
- Variables
- func Count()
- func Round(f float64, n int) float64
- type BaseModel
- type DBClient
- func (client *DBClient) ArchiveAuditsByTimeAndOrg() error
- func (client *DBClient) BatchCreateAudit(audits []model.Audit) error
- func (client *DBClient) BatchCreateMemberExtra(memberExtras []model.MemberExtra) error
- func (client *DBClient) BatchGetNotifyGroup(ids []int64) ([]*apistructs.NotifyGroup, error)
- func (client *DBClient) BatchQueryIssueLabelIDMap(issueIDs []int64) (map[uint64][]uint64, error)
- func (client *DBClient) BulkInsert(objects interface{}, excludeColumns ...string) error
- func (client *DBClient) CheckNotifyGroupNameExist(scopeType, scopeID, name string) (bool, error)
- func (client *DBClient) CheckNotifyNameExist(scopeType, scopeID, name, label string) (bool, error)
- func (client *DBClient) CreateApplication(application *model.Application) error
- func (client *DBClient) CreateApprove(approve *model.Approve) error
- func (client *DBClient) CreateAudit(audit *model.Audit) error
- func (client *DBClient) CreateCurrentOrg(orgRelation *model.CurrentOrg) error
- func (client *DBClient) CreateErrorLog(errorLog *model.ErrorLog) error
- func (client *DBClient) CreateFavoritedResource(resource *model.FavoritedResource) error
- func (client *DBClient) CreateFile(file *File) error
- func (client *DBClient) CreateLabel(label *Label) error
- func (client *DBClient) CreateLabelRelation(lr *LabelRelation) error
- func (client *DBClient) CreateMBox(mbox *model.MBox) error
- func (client *DBClient) CreateMember(member *model.Member) error
- func (client *DBClient) CreateMemberExtra(memberExtra *model.MemberExtra) error
- func (client *DBClient) CreateNotice(notice *Notice) error
- func (client *DBClient) CreateNotify(request *apistructs.CreateNotifyRequest) (int64, error)
- func (client *DBClient) CreateNotifyGroup(request *apistructs.CreateNotifyGroupRequest) (int64, error)
- func (client *DBClient) CreateNotifyHistory(request *apistructs.CreateNotifyHistoryRequest) (int64, error)
- func (client *DBClient) CreateNotifyItem(request *apistructs.CreateNotifyItemRequest) (int64, error)
- func (client *DBClient) CreateOrUpdateNexusRepository(repo *NexusRepository) error
- func (client *DBClient) CreateOrUpdateNexusUser(user *NexusUser) error
- func (client *DBClient) CreateOrg(org *model.Org) error
- func (client *DBClient) CreateOrgClusterRelation(relation *model.OrgClusterRelation) error
- func (client *DBClient) CreateProject(project *model.Project) error
- func (client *DBClient) CreateReview(review *model.ManualReview) error
- func (client *DBClient) CreateReviewUser(review *model.ReviewUser) error
- func (client *DBClient) CreateRolePermission(permission *model.RolePermission) error
- func (client *DBClient) DeleteApplication(applicationID int64) error
- func (client *DBClient) DeleteApprove(approveID int64) error
- func (client *DBClient) DeleteAuditsByTimeAndOrg(startTime time.Time, orgIDs []uint64) error
- func (client *DBClient) DeleteAuditsByTimeAndSys(startTime time.Time) error
- func (client *DBClient) DeleteCurrentOrg(userID string) error
- func (client *DBClient) DeleteFavoritedResource(id uint64) error
- func (client *DBClient) DeleteFavoritedResourcesByTarget(target string, targetID uint64) error
- func (client *DBClient) DeleteFile(id uint64) error
- func (client *DBClient) DeleteLabel(labelID int64) error
- func (client *DBClient) DeleteLabelRelations(refType apistructs.ProjectLabelType, refID uint64) error
- func (client *DBClient) DeleteLabelRelationsByLabel(labelID uint64) error
- func (client *DBClient) DeleteMBox(id int64) error
- func (client *DBClient) DeleteMember(memberID int64) error
- func (client *DBClient) DeleteMemberByScopeAndUsersAndRole(userIDs []string, scopeType apistructs.ScopeType, scopeID int64, role string) error
- func (client *DBClient) DeleteMemberExtraByIDsANDResourceValues(userIDs []string, scopeType apistructs.ScopeType, scopeIDs []int64, ...) error
- func (client *DBClient) DeleteMemberExtraByParentID(userIDs []string, scopeType apistructs.ScopeType, parentID int64) error
- func (client *DBClient) DeleteMemberExtraByParentIDs(userID []string, scopeType apistructs.ScopeType, parentIDs []int64) error
- func (client *DBClient) DeleteMemberExtraByScope(scopeType apistructs.ScopeType, scopeID int64) error
- func (client *DBClient) DeleteMemberExtraByUserIDsAndScope(scopeType apistructs.ScopeType, scopeID int64, userIDs []string) error
- func (client *DBClient) DeleteMemberExtraByUserIDsAndScopeIDs(scopeType apistructs.ScopeType, scopeIDs []int64, userIDs []string) error
- func (client *DBClient) DeleteMemberExtraByUxerIDANDResourceValues(userID string, scopeType apistructs.ScopeType, scopeIDs []int64, ...) error
- func (client *DBClient) DeleteMembersByOrgAndUsers(orgID string, userIDs []string) error
- func (client *DBClient) DeleteMembersByScope(scopeType apistructs.ScopeType, scopeID int64) error
- func (client *DBClient) DeleteMembersByScopeAndUsers(userIDs []string, scopeType apistructs.ScopeType, scopeID int64) error
- func (client *DBClient) DeleteNotice(noticeID uint64) error
- func (client *DBClient) DeleteNotify(id int64, withGroup bool, orgID int64) error
- func (client *DBClient) DeleteNotifyGroup(id int64, orgID int64) error
- func (client *DBClient) DeleteNotifyItem(id int64) error
- func (client *DBClient) DeleteNotifyRelationsByScope(scopeType apistructs.ScopeType, scopeID string) error
- func (client *DBClient) DeleteNotifySource(request *apistructs.DeleteNotifySourceRequest) error
- func (client *DBClient) DeleteOrg(orgID int64) error
- func (client *DBClient) DeleteOrgClusterRelationByCluster(clusterName string) error
- func (client *DBClient) DeleteOrgClusterRelationByClusterAndOrg(clusterName string, orgID int64) error
- func (client *DBClient) DeleteProject(projectID int64) error
- func (client *DBClient) DeleteProjectAppsMembers(userIDs []string, projectID int64) error
- func (client *DBClient) FuzzyQueryNotifiesBySource(req apistructs.FuzzyQueryNotifiesBySourceRequest) ([]*apistructs.NotifyDetail, int, error)
- func (client *DBClient) GetActivitiesByRuntime(runtimeID int64, pageNo, pageSize int) (int, []model.Activity, error)
- func (client *DBClient) GetAllApps() ([]model.Application, error)
- func (client *DBClient) GetAllProjects() ([]model.Project, error)
- func (client *DBClient) GetAppMembersByUser(userID string) ([]model.MemberExtra, error)
- func (client *DBClient) GetApplicationByID(applicationID int64) (model.Application, error)
- func (client *DBClient) GetApplicationByName(projectID int64, name string) (model.Application, error)
- func (client *DBClient) GetApplicationByOrgAndName(orgID int64, name string) (*model.Application, error)
- func (client *DBClient) GetApplicationCountByProjectID(projectID int64) (int64, error)
- func (client *DBClient) GetApplicationsByIDs(orgID *int64, projectID *int64, applicationIDs []int64, ...) (int, []model.Application, error)
- func (client *DBClient) GetApplicationsByProjectID(projectID, pageNum, pageSize int64) ([]model.Application, error)
- func (client *DBClient) GetApplicationsByProjectIDs(projectIDs []uint64) ([]model.Application, error)
- func (client *DBClient) GetApproveByID(approveID int64) (model.Approve, error)
- func (client *DBClient) GetApproveByOrgAndID(approveType apistructs.ApproveType, orgID, targetTD, entityID uint64) (*model.Approve, error)
- func (client *DBClient) GetApprovesByOrgIDAndStatus(params *apistructs.ApproveListRequest) (int, []model.Approve, error)
- func (client *DBClient) GetAuditCleanCron(orgID int64) (*model.Org, error)
- func (client *DBClient) GetAuditSettings() ([]model.AuditSettings, error)
- func (client *DBClient) GetAuditsByParam(param *apistructs.AuditsListRequest) (int, []model.Audit, error)
- func (client *DBClient) GetAuthorityByUserId(param *apistructs.GetAuthorityByUserIdRequest) (apistructs.GetAuthorityByUserIdResponse, error)
- func (client *DBClient) GetCurrentOrgByUser(userID string) (int64, error)
- func (client *DBClient) GetErrorLogByDedupIndex(resourceID string, resourceType apistructs.ErrorResourceType, dedupID string) (*model.ErrorLog, error)
- func (client *DBClient) GetFavoritedResource(target string, targetID uint64, userID string) (*model.FavoritedResource, error)
- func (client *DBClient) GetFavoritedResourcesByUser(target, userID string) ([]model.FavoritedResource, error)
- func (client *DBClient) GetFile(id uint64) (File, error)
- func (client *DBClient) GetFileByUUID(uuid string) (File, error)
- func (client *DBClient) GetJoinedAppNumByUserId(userID, orgID string) (int, error)
- func (client *DBClient) GetJoinedProjectNumByUserID(userID string, orgID string) (int, []string, error)
- func (client *DBClient) GetLabel(labelID int64) (*Label, error)
- func (client *DBClient) GetLabelByName(projectID uint64, name string) (*Label, error)
- func (client *DBClient) GetLabelRelationsByLabels(refType apistructs.ProjectLabelType, labelIDs []uint64) ([]LabelRelation, error)
- func (client *DBClient) GetLabelRelationsByRef(refType apistructs.ProjectLabelType, refID uint64) ([]LabelRelation, error)
- func (client *DBClient) GetLabels(labelIDs []uint64) ([]Label, error)
- func (client *DBClient) GetMBox(id int64, orgID int64, userID string) (*apistructs.MBox, error)
- func (client *DBClient) GetMBoxStats(orgID int64, userID string) (*apistructs.QueryMBoxStatsData, error)
- func (client *DBClient) GetManagerMemberCountByUserID(userIDs []string, scopeID int64, scopeType apistructs.ScopeType) (uint64, error)
- func (client *DBClient) GetManagerMembersCount(scopeID int64, scopeType apistructs.ScopeType) (uint64, error)
- func (client *DBClient) GetMboxByDeduplicateID(orgID int64, deduplicateID, userID string) (*model.MBox, error)
- func (client *DBClient) GetMeberExtraByParentID(userIDs []string, scopeType apistructs.ScopeType, parentID int64) ([]model.MemberExtra, error)
- func (client *DBClient) GetMeberRoleByParentID(userID string, scopeType apistructs.ScopeType, parentID int64) ([]model.MemberExtra, error)
- func (client *DBClient) GetMemberByID(memberID int64) (*model.Member, error)
- func (client *DBClient) GetMemberByIDs(memberIDs []int64) ([]model.Member, error)
- func (client *DBClient) GetMemberByScopeAndRole(scopeType apistructs.ScopeType, scopeIDs []uint64, roles []string) ([]model.MemberExtra, error)
- func (client *DBClient) GetMemberByScopeAndUserID(userID string, scopeType apistructs.ScopeType, scopeID int64) ([]model.MemberJoin, error)
- func (client *DBClient) GetMemberByToken(token string) (*model.Member, error)
- func (client *DBClient) GetMemberByUserID(userID string) ([]model.Member, error)
- func (client *DBClient) GetMemberByUserIDAndScopeIDs(userID string, scopeType apistructs.ScopeType, scopeIDs []int64) ([]model.Member, error)
- func (client *DBClient) GetMemberByUserIDsAndScope(userIDs []string, scopeType apistructs.ScopeType, scopeID int64) ([]model.Member, error)
- func (client *DBClient) GetMemberExtra(userIDs []string, scopeType apistructs.ScopeType, scopeID int64, ...) ([]model.MemberExtra, error)
- func (client *DBClient) GetMemberExtraByIDs(userIDs []string, scopeType apistructs.ScopeType, scopeIDs []int64, ...) ([]model.MemberExtra, error)
- func (client *DBClient) GetMembersByOrgAndUser(orgID int64, userID string) ([]model.MemberJoin, error)
- func (client *DBClient) GetMembersByParam(param *apistructs.MemberListRequest) (int, []model.Member, error)
- func (client *DBClient) GetMembersByParentID(scopeType apistructs.ScopeType, parentID int64, userID string) ([]model.MemberJoin, error)
- func (client *DBClient) GetMembersByScope(scopeType apistructs.ScopeType, scopeIDs []string, roles []string) ([]model.Member, error)
- func (client *DBClient) GetMembersByScopeType(scopeType apistructs.ScopeType) ([]model.Member, error)
- func (client *DBClient) GetMembersByScopeTypeAndUser(scopeType apistructs.ScopeType, userID string) ([]model.Member, error)
- func (client *DBClient) GetMembersWithoutExtraByScope(scopeType apistructs.ScopeType, scopeID int64) (int, []model.Member, error)
- func (client *DBClient) GetNexusRepository(id uint64) (*NexusRepository, error)
- func (client *DBClient) GetNexusRepositoryByName(name string) (*NexusRepository, error)
- func (client *DBClient) GetNexusUser(id uint64) (*NexusUser, error)
- func (client *DBClient) GetNexusUserByName(name string) (*NexusUser, error)
- func (client *DBClient) GetNotice(noticeID uint64) (*Notice, error)
- func (client *DBClient) GetNotifyByGroupID(groupID int64) (*model.Notify, error)
- func (client *DBClient) GetNotifyDetail(id int64, orgID int64) (*apistructs.NotifyDetail, error)
- func (client *DBClient) GetNotifyGroupByID(id int64, orgID int64) (*apistructs.NotifyGroup, error)
- func (client *DBClient) GetNotifyGroupByIDWithoutOrgID(id int64) (*apistructs.NotifyGroup, error)
- func (client *DBClient) GetNotifyGroupNameByID(id int64, orgID int64) (*apistructs.NotifyGroup, error)
- func (client *DBClient) GetNotifyItemsByNotifyID(notifyID int64) ([]*apistructs.NotifyItem, error)
- func (client *DBClient) GetNotifyItemsByNotifyIDAndItemName(notifyID int64, itemName string) ([]*apistructs.NotifyItem, error)
- func (client *DBClient) GetNotifySourcesByNotifyID(notifyID int64) ([]*apistructs.NotifySource, error)
- func (client *DBClient) GetOperatorByTaskID(taskID []int) ([]model.ReviewUser, error)
- func (client *DBClient) GetOrg(orgID int64) (model.Org, error)
- func (client *DBClient) GetOrgByName(orgName string) (*model.Org, error)
- func (client *DBClient) GetOrgByUserIDs(userIDs []string) ([]model.Member, error)
- func (client *DBClient) GetOrgClusterRelationByOrgAndCluster(orgID, clusterID int64) (*model.OrgClusterRelation, error)
- func (client *DBClient) GetOrgClusterRelationsByOrg(orgID int64) ([]model.OrgClusterRelation, error)
- func (client *DBClient) GetOrgList() ([]model.Org, error)
- func (client *DBClient) GetOrgsByIDsAndName(orgIDs []int64, name string, pageNo, pageSize int) (int, []model.Org, error)
- func (client *DBClient) GetOrgsByParam(name string, pageNum, pageSize int) (int, []model.Org, error)
- func (client *DBClient) GetOrgsByUserID(userID string) ([]model.Org, error)
- func (client *DBClient) GetOwnerMemberCountByUserID(userIDs []string, scopeID int64, scopeType apistructs.ScopeType) (uint64, error)
- func (client *DBClient) GetOwnerMembersCount(scopeID int64, scopeType apistructs.ScopeType) (uint64, error)
- func (client *DBClient) GetPermissionList(roles []string) ([]model.RolePermission, []model.RolePermission)
- func (client *DBClient) GetProjectApplications(projectID int64) ([]model.Application, error)
- func (client *DBClient) GetProjectByID(projectID int64) (model.Project, error)
- func (client *DBClient) GetProjectByOrgAndName(orgID int64, name string) (*model.Project, error)
- func (client *DBClient) GetProjectIDListByStates(req apistructs.IssuePagingRequest, projectIDList []uint64) (int, []model.Project, error)
- func (client *DBClient) GetProjectMembersByUser(userID string) ([]model.MemberExtra, error)
- func (client *DBClient) GetProjectsByIDs(projectIDs []uint64, params *apistructs.ProjectListRequest) (int, []model.Project, error)
- func (client *DBClient) GetProjectsByOrgIDAndName(orgID int64, params *apistructs.ProjectListRequest) (int, []model.Project, error)
- func (client *DBClient) GetPublicOrgsByParam(name string, pageNum, pageSize int) (int, []model.Org, error)
- func (client *DBClient) GetReviewByID(id int64) (review model.ManualReview, err error)
- func (client *DBClient) GetReviewByTaskId(param *apistructs.GetReviewByTaskIdIdRequest) (apistructs.GetReviewByTaskIdIdResponse, error)
- func (client *DBClient) GetReviewsBySponsorId(param *apistructs.GetReviewsBySponsorIdRequest) (int, []model.ManualReview, error)
- func (client *DBClient) GetReviewsByUserId(param *apistructs.GetReviewsByUserIdRequest, tasks []int64) (int, []model.ManualReview, error)
- func (client *DBClient) GetRolePermission(roles []string, permissionInfo *apistructs.PermissionCheckRequest) (*model.RolePermission, error)
- func (client *DBClient) GetScopeManagersByScopeID(scopeType apistructs.ScopeType, scopeID int64) ([]apistructs.Member, error)
- func (client *DBClient) GetScopeNameByScope(scopeType apistructs.ScopeType, scopeID int64) string
- func (client *DBClient) GetTaskIDByOperator(param *apistructs.GetReviewsByUserIdRequest) ([]int64, error)
- func (client *DBClient) GetUcUserID(uuid string) (string, error)
- func (client *DBClient) GetUcUserList() ([]model.User, error)
- func (client *DBClient) InitOrgAuditInterval(orgIDs []uint64) error
- func (client *DBClient) InsertMapping(userID, uuid, hash string) error
- func (client *DBClient) IsSysAdmin(userID string) (bool, error)
- func (client *DBClient) ListAllOrgClusterRelations() ([]model.OrgClusterRelation, error)
- func (client *DBClient) ListErrorLogByResources(resourceTypes []apistructs.ErrorResourceType, resourceIDs []string) ([]model.ErrorLog, error)
- func (client *DBClient) ListErrorLogByResourcesAndStartTime(resourceTypes []apistructs.ErrorResourceType, resourceIDs []string, ...) ([]model.ErrorLog, error)
- func (client *DBClient) ListExpiredFiles(expiredAt time.Time) ([]File, error)
- func (client *DBClient) ListLabel(req *apistructs.ProjectLabelListRequest) (int64, []Label, error)
- func (client *DBClient) ListLabelByNames(projectID uint64, names []string) ([]Label, error)
- func (client *DBClient) ListNexusRepositories(req apistructs.NexusRepositoryListRequest) ([]*NexusRepository, error)
- func (client *DBClient) ListNexusUsers(req apistructs.NexusUserListRequest) ([]NexusUser, error)
- func (client *DBClient) ListNotice(req *apistructs.NoticeListRequest) (uint64, []Notice, error)
- func (client *DBClient) ListProjectByCluster(clusterName string) ([]model.Project, error)
- func (client *DBClient) ListProjectByOrgID(orgID uint64) ([]model.Project, error)
- func (client *DBClient) ListUnblockApplicationApprove(orgID uint64) ([]model.Approve, error)
- func (client *DBClient) PageMeberRoleByParentID(req apistructs.ListMemberRolesByUserRequest) (int, []model.Member, error)
- func (client *DBClient) QueryAppPublishItemRelations(req apistructs.QueryAppPublishItemRelationRequest) ([]apistructs.AppPublishItemRelation, error)
- func (client *DBClient) QueryMBox(request *apistructs.QueryMBoxRequest) (*apistructs.QueryMBoxData, error)
- func (client *DBClient) QueryNotifies(request *apistructs.QueryNotifyRequest) (*apistructs.QueryNotifyData, error)
- func (client *DBClient) QueryNotifiesBySource(sourceType, sourceID, itemName string, orgID int64, clusterName string, ...) ([]*apistructs.NotifyDetail, error)
- func (client *DBClient) QueryNotifyGroup(request *apistructs.QueryNotifyGroupRequest, orgID int64) (*apistructs.QueryNotifyGroupData, error)
- func (client *DBClient) QueryNotifyHistories(request *apistructs.QueryNotifyHistoryRequest) (*apistructs.QueryNotifyHistoryData, error)
- func (client *DBClient) QueryNotifyItems(request *apistructs.QueryNotifyItemRequest) (*apistructs.QueryNotifyItemData, error)
- func (client *DBClient) QuerytNotifyItemsByNotifyIDAndItemName(notifyID int64, itemName string) ([]*apistructs.NotifyItem, error)
- func (client *DBClient) ReadAll(orgID int64, userID string) error
- func (client *DBClient) RemovePublishItemRelations(request *apistructs.RemoveAppPublishItemRelationsRequest) error
- func (client *DBClient) SetMBoxReadStatus(request *apistructs.SetMBoxReadStatusRequest) error
- func (db *DBClient) Transaction(f func(tx *gorm.DB) error) error
- func (client *DBClient) UpdateAppPublishItemRelations(request *apistructs.UpdateAppPublishItemRelationRequest) error
- func (client *DBClient) UpdateApplication(application *model.Application) error
- func (client *DBClient) UpdateApproval(param *apistructs.UpdateApproval) error
- func (client *DBClient) UpdateApprove(approve *model.Approve) error
- func (client *DBClient) UpdateAuditCleanCron(orgID, interval int64) error
- func (client *DBClient) UpdateCurrentOrg(userID string, orgID int64) error
- func (client *DBClient) UpdateErrorLog(errorLog *model.ErrorLog) error
- func (client *DBClient) UpdateLabel(label *Label) error
- func (client *DBClient) UpdateMbox(mbox *model.MBox) error
- func (client *DBClient) UpdateMember(member *model.Member) error
- func (client *DBClient) UpdateMemberUserInfo(ids []int64, fields map[string]interface{}) error
- func (client *DBClient) UpdateNotice(notice *Notice) error
- func (client *DBClient) UpdateNotify(request *apistructs.UpdateNotifyRequest) error
- func (client *DBClient) UpdateNotifyEnable(id int64, enabled bool, orgID int64) error
- func (client *DBClient) UpdateNotifyGroup(request *apistructs.UpdateNotifyGroupRequest) error
- func (client *DBClient) UpdateNotifyItem(request *apistructs.UpdateNotifyItemRequest) error
- func (client *DBClient) UpdateOrg(org *model.Org) error
- func (client *DBClient) UpdateProject(project *model.Project) error
- func (client *DBClient) UpdateProjectQuota(clusterName string, cpuOverSellChangeRatio float64) error
- type File
- type FileExtra
- type Int64Slice
- type Label
- type LabelRelation
- type NexusRepository
- type NexusRepositoryConfig
- type NexusUser
- type NexusUserConfig
- type Notice
- type OSSSnapshot
- type ProjectID
Constants ¶
const BULK_INSERT_CHUNK_SIZE = 3000
const DIALECT = "mysql"
DIALECT db 类型
Variables ¶
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 ¶
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 ¶
DBClient db client
func (*DBClient) ArchiveAuditsByTimeAndOrg ¶
ArchiveAuditsByTimeAndOrg 归档某个企业的审计事件
func (*DBClient) BatchCreateAudit ¶
BatchCreateAudit 批量传教审计
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 ¶
BatchQueryIssueLabelIDMap 批量查询 issue label id
func (*DBClient) BulkInsert ¶
func (*DBClient) CheckNotifyGroupNameExist ¶
func (*DBClient) CheckNotifyNameExist ¶
func (*DBClient) CreateApplication ¶
func (client *DBClient) CreateApplication(application *model.Application) error
CreateApplication 创建应用
func (*DBClient) CreateApprove ¶
CreateApprove 创建Approve
func (*DBClient) CreateAudit ¶
CreateAudit 创建审计
func (*DBClient) CreateCurrentOrg ¶
func (client *DBClient) CreateCurrentOrg(orgRelation *model.CurrentOrg) error
CreateCurrentOrg 添加用户当前所属企业
func (*DBClient) CreateErrorLog ¶
CreateErrorLog 创建错误日志
func (*DBClient) CreateFavoritedResource ¶
func (client *DBClient) CreateFavoritedResource(resource *model.FavoritedResource) error
CreateFavoritedResource 创建收藏关系
func (*DBClient) CreateFile ¶
func (*DBClient) CreateLabel ¶
CreateLabel 创建 label
func (*DBClient) CreateLabelRelation ¶
func (client *DBClient) CreateLabelRelation(lr *LabelRelation) error
CreateLabelRelation 创建标签关联关系
func (*DBClient) CreateMember ¶
CreateMember 创建成员
func (*DBClient) CreateMemberExtra ¶
func (client *DBClient) CreateMemberExtra(memberExtra *model.MemberExtra) error
CreateMemberExtra 创建成员关联关系
func (*DBClient) CreateNotice ¶
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 (*DBClient) CreateOrgClusterRelation ¶
func (client *DBClient) CreateOrgClusterRelation(relation *model.OrgClusterRelation) error
CreateOrgClusterRelation 创建企业集群关系
func (*DBClient) CreateProject ¶
CreateProject 创建项目
func (*DBClient) CreateReview ¶
func (client *DBClient) CreateReview(review *model.ManualReview) error
func (*DBClient) CreateReviewUser ¶
func (client *DBClient) CreateReviewUser(review *model.ReviewUser) error
CreateReviewUser 创建成员
func (*DBClient) CreateRolePermission ¶
func (client *DBClient) CreateRolePermission(permission *model.RolePermission) error
CreateRolePermission 创建角色权限
func (*DBClient) DeleteApplication ¶
DeleteApplication 删除应用
func (*DBClient) DeleteApprove ¶
DeleteApprove 删除Approve
func (*DBClient) DeleteAuditsByTimeAndOrg ¶
DeleteAuditsByTimeAndOrg 软删除某个企业的审计事件
func (*DBClient) DeleteAuditsByTimeAndSys ¶
DeleteAuditsByTimeAndSys 软删除系统级别的审计事件
func (*DBClient) DeleteCurrentOrg ¶
DeleteCurrentOrg 删除当前用户所属企业
func (*DBClient) DeleteFavoritedResource ¶
DeleteFavoritedResource 删除收藏关系
func (*DBClient) DeleteFavoritedResourcesByTarget ¶
DeleteFavoritedResourcesByTarget 根据 target 删除收藏关系
func (*DBClient) DeleteFile ¶
func (*DBClient) DeleteLabel ¶
DeleteLabel 删除标签
func (*DBClient) DeleteLabelRelations ¶
func (client *DBClient) DeleteLabelRelations(refType apistructs.ProjectLabelType, refID uint64) error
DeleteLabelRelations 删除标签关联关系
func (*DBClient) DeleteLabelRelationsByLabel ¶
DeleteLabelRelationsByLabel 根据 labelID 删除标签
func (*DBClient) DeleteMBox ¶
func (*DBClient) DeleteMember ¶
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 ¶
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 ¶
DeleteNotice 删除公告
func (*DBClient) DeleteNotify ¶
func (*DBClient) DeleteNotifyGroup ¶
func (*DBClient) DeleteNotifyItem ¶
func (*DBClient) DeleteNotifyRelationsByScope ¶
func (client *DBClient) DeleteNotifyRelationsByScope(scopeType apistructs.ScopeType, scopeID string) error
DeleteNotifyRelationsByScope 删除对应关联的通知信息
func (*DBClient) DeleteNotifySource ¶
func (client *DBClient) DeleteNotifySource(request *apistructs.DeleteNotifySourceRequest) error
func (*DBClient) DeleteOrgClusterRelationByCluster ¶
DeleteOrgClusterRelationByCluster 根据 clusterName 删除企业集群关联关系
func (*DBClient) DeleteOrgClusterRelationByClusterAndOrg ¶
func (client *DBClient) DeleteOrgClusterRelationByClusterAndOrg(clusterName string, orgID int64) error
DeleteOrgClusterRelationByClusterAndOrg 根据 clusterName、orgID 删除企业集群关联关系
func (*DBClient) DeleteProject ¶
DeleteProject 删除项目
func (*DBClient) DeleteProjectAppsMembers ¶
DeleteProjectAppsMembers 删除该用户对应项目下的应用权限
func (*DBClient) FuzzyQueryNotifiesBySource ¶
func (client *DBClient) FuzzyQueryNotifiesBySource(req apistructs.FuzzyQueryNotifiesBySourceRequest) ([]*apistructs.NotifyDetail, int, error)
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 ¶
GetAllProjects get all projects
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 ¶
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 ¶
GetApproveByID 根据approveID获取Approve信息
func (*DBClient) GetApproveByOrgAndID ¶
func (client *DBClient) GetApproveByOrgAndID(approveType apistructs.ApproveType, orgID, targetTD, entityID uint64) (*model.Approve, error)
GetApproveByOrgAndID 根据orgID & Approve名称 获取证书信息
func (*DBClient) GetApprovesByOrgIDAndStatus ¶
func (client *DBClient) GetApprovesByOrgIDAndStatus(params *apistructs.ApproveListRequest) ( int, []model.Approve, error)
GetApprovesByOrgIDAndStatus 根据orgID与审批状态获取Approve列表
func (*DBClient) GetAuditCleanCron ¶
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) GetAuthorityByUserId ¶
func (client *DBClient) GetAuthorityByUserId(param *apistructs.GetAuthorityByUserIdRequest) (apistructs.GetAuthorityByUserIdResponse, error)
func (*DBClient) GetCurrentOrgByUser ¶
GetCurrentOrgByUser 根据userID获取当前所属企业ID
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) GetJoinedAppNumByUserId ¶
GetJoinedAppNumByUserId get joined apps num by user and org
func (*DBClient) GetJoinedProjectNumByUserID ¶
func (client *DBClient) GetJoinedProjectNumByUserID(userID string, orgID string) (int, []string, error)
GetJoinedProjectNumByUserID get projects by userID and orgID
func (*DBClient) GetLabelByName ¶
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) 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) GetMboxByDeduplicateID ¶
func (client *DBClient) GetMboxByDeduplicateID(orgID int64, deduplicateID, userID string) (*model.MBox, error)
GetMboxByDeduplicateID get a mbox by deduplicate_id
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 ¶
GetMemberByID 根据memberID获取成员
func (*DBClient) GetMemberByIDs ¶
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 ¶
GetMemberByToken 根据token获取成员
func (*DBClient) GetMemberByUserID ¶
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)
GetMembersWithoutExtraByScope 根据parentID 信息查询成员,不带角色label等信息
func (*DBClient) GetNexusRepository ¶
func (client *DBClient) GetNexusRepository(id uint64) (*NexusRepository, error)
func (*DBClient) GetNexusRepositoryByName ¶
func (client *DBClient) GetNexusRepositoryByName(name string) (*NexusRepository, error)
func (*DBClient) GetNexusUserByName ¶
func (*DBClient) GetNotifyByGroupID ¶
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) GetOperatorByTaskID ¶
func (client *DBClient) GetOperatorByTaskID(taskID []int) ([]model.ReviewUser, error)
func (*DBClient) GetOrgByName ¶
GetOrgByName 根据 orgName 获取企业信息
func (*DBClient) GetOrgByUserIDs ¶
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 ¶
GetOrgList 获取所有企业列表(仅供内部用户使用)
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 ¶
GetOrgsByUserID 根据userID获取企业列表
func (*DBClient) GetOwnerMemberCountByUserID ¶
func (client *DBClient) GetOwnerMemberCountByUserID(userIDs []string, scopeID int64, scopeType apistructs.ScopeType) (uint64, error)
GetOwnerMemberCountByUserID 获取某个用户的项目/应用所有者的数量
func (*DBClient) GetOwnerMembersCount ¶
func (client *DBClient) GetOwnerMembersCount(scopeID int64, scopeType apistructs.ScopeType) (uint64, error)
GetOwnerMembersCount 根据scopeID获取项目/应用所有者的数量
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 ¶
GetProjectByID 根据projectID获取项目信息
func (*DBClient) GetProjectByOrgAndName ¶
GetProjectByOrgAndName 根据orgID & 项目名称 获取项目
func (*DBClient) GetProjectIDListByStates ¶
func (client *DBClient) GetProjectIDListByStates(req apistructs.IssuePagingRequest, projectIDList []uint64) (int, []model.Project, error)
GetProjectIDListByStates 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) GetPublicOrgsByParam ¶
func (client *DBClient) GetPublicOrgsByParam(name string, pageNum, pageSize int) (int, []model.Org, error)
Get public orgs list
func (*DBClient) GetReviewByID ¶
func (client *DBClient) GetReviewByID(id int64) (review model.ManualReview, err error)
GetReviewByID get review by id
func (*DBClient) GetReviewByTaskId ¶
func (client *DBClient) GetReviewByTaskId(param *apistructs.GetReviewByTaskIdIdRequest) (apistructs.GetReviewByTaskIdIdResponse, error)
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) GetScopeManagersByScopeID ¶
func (client *DBClient) GetScopeManagersByScopeID(scopeType apistructs.ScopeType, scopeID int64) ([]apistructs.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) GetUcUserID ¶ added in v1.3.0
func (*DBClient) GetUcUserList ¶ added in v1.3.0
func (*DBClient) InitOrgAuditInterval ¶
InitOrgAuditInterval 初始化企业的审计事件清理周期
func (*DBClient) InsertMapping ¶ added in v1.3.0
func (*DBClient) IsSysAdmin ¶
IsSysAdmin 判断用户是否为系统管理员
func (*DBClient) ListAllOrgClusterRelations ¶
func (client *DBClient) ListAllOrgClusterRelations() ([]model.OrgClusterRelation, error)
ListAllOrgClusterRelations 获取所有企业对应集群关系
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) ListExpiredFiles ¶
func (*DBClient) ListLabel ¶
func (client *DBClient) ListLabel(req *apistructs.ProjectLabelListRequest) (int64, []Label, error)
ListLabel 获取标签列表
func (*DBClient) ListLabelByNames ¶
ListLabelByNames 根据 name 列表获取标签列表
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 ¶
ListProjectByCluster 根据clusterName 获取项目列表
func (*DBClient) ListProjectByOrgID ¶
ListProjectByOrgID 根据 orgID 获取项目列表
func (*DBClient) ListUnblockApplicationApprove ¶
func (*DBClient) PageMeberRoleByParentID ¶
func (client *DBClient) PageMeberRoleByParentID(req apistructs.ListMemberRolesByUserRequest) (int, []model.Member, error)
PageMeberRoleByParentID 通过用户和父scope分页查询成员角色
func (*DBClient) QueryAppPublishItemRelations ¶
func (client *DBClient) QueryAppPublishItemRelations(req apistructs.QueryAppPublishItemRelationRequest) ([]apistructs.AppPublishItemRelation, error)
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) RemovePublishItemRelations ¶
func (client *DBClient) RemovePublishItemRelations(request *apistructs.RemoveAppPublishItemRelationsRequest) error
func (*DBClient) SetMBoxReadStatus ¶
func (client *DBClient) SetMBoxReadStatus(request *apistructs.SetMBoxReadStatusRequest) error
func (*DBClient) Transaction ¶ added in v1.3.0
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) UpdateApprove ¶
UpdateApprove 更新Approve
func (*DBClient) UpdateAuditCleanCron ¶
UpdateAuditCleanCron 修改企业事件清理周期
func (*DBClient) UpdateCurrentOrg ¶
UpdateCurrentOrg 更新用户当前所属企业
func (*DBClient) UpdateErrorLog ¶
UpdateErrorLog 更新错误日志记录
func (*DBClient) UpdateLabel ¶
UpdateLabel 更新 label
func (*DBClient) UpdateMbox ¶
UpdateMbox update mbox
func (*DBClient) UpdateMember ¶
UpdateMember 更新成员
func (*DBClient) UpdateMemberUserInfo ¶
UpdateMemberUserInfo 更新成员 userinfo 信息
func (*DBClient) UpdateNotice ¶
UpdateNotice 编辑公告
func (*DBClient) UpdateNotify ¶
func (client *DBClient) UpdateNotify(request *apistructs.UpdateNotifyRequest) error
func (*DBClient) UpdateNotifyEnable ¶
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) UpdateProject ¶
UpdateProject 更新项目
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 // 文件超时自动删除 }
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"` }
type Int64Slice ¶
type Int64Slice []int64
Int64Slice 自定义 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 Label ¶
type Label struct { BaseModel Name string // 标签名称 Type apistructs.ProjectLabelType // 标签作用类型 Color string // 标签颜色 ProjectID uint64 // 标签所属项目 Creator string // 创建人 }
Label 标签
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 标签关联关系
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
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"` }
type NexusUserConfig ¶
func (*NexusUserConfig) Scan ¶
func (config *NexusUserConfig) Scan(value interface{}) error
type Notice ¶
type Notice struct { BaseModel OrgID uint64 Content string Status apistructs.NoticeStatus Creator string }
Notice 平台公告
type OSSSnapshot ¶
Source Files ¶
- activity.go
- app_publish_item_relation.go
- application.go
- approve.go
- audit.go
- base.go
- current_org.go
- error.go
- errorbox.go
- favorited_resource.go
- file.go
- label.go
- label_relation.go
- manual_review.go
- mbox.go
- member.go
- member_extra.go
- migration.go
- mysql.go
- nexus_repository.go
- nexus_user.go
- notice.go
- notify.go
- notify_group.go
- notify_history.go
- notify_item.go
- notify_source.go
- org_cluster_relation.go
- organization.go
- print.go
- project.go
- review_uesr.go
- role_permission.go
- utlis.go