Documentation ¶
Overview ¶
Package project 封装项目资源相关操作
Index ¶
- func RunningPodCond(projectID uint64) map[string]interface{}
- type Option
- type Project
- func (p *Project) BatchConvertProjectDTO(joined map[int64]bool, projects []model.Project) []apistructs.ProjectDTO
- func (p *Project) Create(userID string, createReq *apistructs.ProjectCreateRequest) (*model.Project, error)
- func (p *Project) CreateWithEvent(userID string, createReq *apistructs.ProjectCreateRequest) (int64, error)
- func (p *Project) Delete(projectID int64) (*model.Project, error)
- func (p *Project) DeleteWithEvent(projectID int64) error
- func (p *Project) Get(ctx context.Context, projectID int64, withQuota bool) (*apistructs.ProjectDTO, error)
- func (p *Project) GetAllProjects() ([]apistructs.ProjectDTO, error)
- func (p *Project) GetModelProject(projectID int64) (*model.Project, error)
- func (p *Project) GetModelProjectsMap(projectIDs []uint64, keepMsp bool) (map[int64]*model.Project, error)
- func (p *Project) GetMyProjectIDList(parentID int64, userID string, mustManager bool) ([]uint64, error)
- func (p *Project) GetNamespacesBelongsTo(ctx context.Context, orgID uint64, clusterNames []string) (*apistructs.GetProjectsNamesapcesResponseData, error)
- func (p *Project) GetProjectIDListByStates(req apistructs.IssuePagingRequest, projectIDList []uint64) (int, []apistructs.ProjectDTO, error)
- func (p *Project) GetProjectNSInfo(projectID int64) (*apistructs.ProjectNameSpaceInfo, error)
- func (p *Project) GetProjectStats(projectID int64) (*apistructs.ProjectStats, error)
- func (p *Project) GetQuotaOnClusters(orgID int64, clusterNames []string) (*apistructs.GetQuotaOnClustersResponse, error)
- func (p *Project) ListAllProjects(userID string, params *apistructs.ProjectListRequest) (*apistructs.PagingProjectDTO, error)
- func (p *Project) ListJoinedProjects(orgID int64, userID string, params *apistructs.ProjectListRequest) (*apistructs.PagingProjectDTO, error)
- func (p *Project) ListPublicProjects(userID string, params *apistructs.ProjectListRequest) (*apistructs.PagingProjectDTO, error)
- func (p *Project) ListQuotaRecords(ctx context.Context) ([]*apistructs.ProjectQuota, error)
- func (p *Project) ListUnblockAppCountsByProjectIDS(projectIDS []uint64) ([]model.ProjectUnblockAppCount, error)
- func (p *Project) ReferCluster(clusterName string, orgID uint64) bool
- func (p *Project) Update(ctx context.Context, orgID, projectID int64, userID string, ...) (*model.Project, error)
- func (p *Project) UpdateProjectActiveTime(req *apistructs.ProjectActiveTimeUpdateRequest) error
- func (p *Project) UpdateProjectFunction(req *apistructs.ProjectFunctionSetRequest) (int64, error)
- func (p *Project) UpdateWithEvent(ctx context.Context, orgID, projectID int64, userID string, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunningPodCond ¶
Types ¶
type Project ¶
type Project struct {
// contains filtered or unexported fields
}
Project 资源对象操作封装
func (*Project) BatchConvertProjectDTO ¶
func (p *Project) BatchConvertProjectDTO(joined map[int64]bool, projects []model.Project) []apistructs.ProjectDTO
func (*Project) Create ¶
func (p *Project) Create(userID string, createReq *apistructs.ProjectCreateRequest) (*model.Project, error)
Create 创建项目
func (*Project) CreateWithEvent ¶
func (p *Project) CreateWithEvent(userID string, createReq *apistructs.ProjectCreateRequest) (int64, error)
CreateWithEvent 创建项目 & 发送事件
func (*Project) DeleteWithEvent ¶
DeleteWithEvent 删除项目 & 发送事件
func (*Project) Get ¶
func (p *Project) Get(ctx context.Context, projectID int64, withQuota bool) (*apistructs.ProjectDTO, error)
Get 获取项目
func (*Project) GetAllProjects ¶
func (p *Project) GetAllProjects() ([]apistructs.ProjectDTO, error)
GetAllProjects list all project
func (*Project) GetModelProject ¶
GetModelProject 获取项目
func (*Project) GetModelProjectsMap ¶
func (*Project) GetMyProjectIDList ¶
func (*Project) GetNamespacesBelongsTo ¶
func (p *Project) GetNamespacesBelongsTo(ctx context.Context, orgID uint64, clusterNames []string) (*apistructs.GetProjectsNamesapcesResponseData, error)
func (*Project) GetProjectIDListByStates ¶
func (p *Project) GetProjectIDListByStates(req apistructs.IssuePagingRequest, projectIDList []uint64) (int, []apistructs.ProjectDTO, error)
func (*Project) GetProjectNSInfo ¶
func (p *Project) GetProjectNSInfo(projectID int64) (*apistructs.ProjectNameSpaceInfo, error)
GetProjectNSInfo 获取项目级别命名空间信息
func (*Project) GetProjectStats ¶
func (p *Project) GetProjectStats(projectID int64) (*apistructs.ProjectStats, error)
GetProjectStats 获取项目状态
func (*Project) GetQuotaOnClusters ¶
func (p *Project) GetQuotaOnClusters(orgID int64, clusterNames []string) (*apistructs.GetQuotaOnClustersResponse, error)
func (*Project) ListAllProjects ¶
func (p *Project) ListAllProjects(userID string, params *apistructs.ProjectListRequest) ( *apistructs.PagingProjectDTO, error)
ListAllProjects 企业管理员可查看当前企业下所有项目,包括未加入的项目
func (*Project) ListJoinedProjects ¶
func (p *Project) ListJoinedProjects(orgID int64, userID string, params *apistructs.ProjectListRequest) ( *apistructs.PagingProjectDTO, error)
ListJoinedProjects 返回用户有权限的项目
func (*Project) ListPublicProjects ¶
func (p *Project) ListPublicProjects(userID string, params *apistructs.ProjectListRequest) ( *apistructs.PagingProjectDTO, error)
ListPublicProjects 获取公开项目列表
func (*Project) ListQuotaRecords ¶
func (p *Project) ListQuotaRecords(ctx context.Context) ([]*apistructs.ProjectQuota, error)
func (*Project) ListUnblockAppCountsByProjectIDS ¶
func (p *Project) ListUnblockAppCountsByProjectIDS(projectIDS []uint64) ([]model.ProjectUnblockAppCount, error)
func (*Project) ReferCluster ¶
ReferCluster 检查 cluster 是否被某个项目所使用
func (*Project) Update ¶
func (p *Project) Update(ctx context.Context, orgID, projectID int64, userID string, updateReq *apistructs.ProjectUpdateBody) (*model.Project, error)
Update 更新项目
func (*Project) UpdateProjectActiveTime ¶
func (p *Project) UpdateProjectActiveTime(req *apistructs.ProjectActiveTimeUpdateRequest) error
UpdateProjectActiveTime 更新项目活跃时间
func (*Project) UpdateProjectFunction ¶
func (p *Project) UpdateProjectFunction(req *apistructs.ProjectFunctionSetRequest) (int64, error)
UpdateProjectFunction 更新项目的功能开关
func (*Project) UpdateWithEvent ¶
func (p *Project) UpdateWithEvent(ctx context.Context, orgID, projectID int64, userID string, updateReq *apistructs.ProjectUpdateBody) error
UpdateWithEvent 更新项目 & 发送事件
Click to show internal directories.
Click to hide internal directories.