project

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2021 License: AGPL-3.0 Imports: 17 Imported by: ? 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

Overview

Package project 封装项目资源相关操作

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Project)

Option 定义 Project 对象的配置选项

func WithBundle

func WithBundle(bdl *bundle.Bundle) Option

WithBundle 配置 bundle

func WithDBClient

func WithDBClient(db *dao.DBClient) Option

WithDBClient 配置 db client

func WithUCClient

func WithUCClient(uc *ucauth.UCClient) Option

WithUCClient 配置 uc client

type Project

type Project struct {
	// contains filtered or unexported fields
}

Project 资源对象操作封装

func New

func New(options ...Option) *Project

New 新建 Project 实例,通过 Project 实例操作企业资源

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) Delete

func (p *Project) Delete(projectID int64) (*model.Project, error)

Delete 删除项目

func (*Project) DeleteWithEvent

func (p *Project) DeleteWithEvent(projectID int64) error

DeleteWithEvent 删除项目 & 发送事件

func (*Project) FillQuota

func (p *Project) FillQuota(orgResources map[uint64]apistructs.OrgResourceInfo) error

FillQuota 根据项目资源使用情况填充项目资源配额

func (*Project) Get

func (p *Project) Get(projectID int64) (*apistructs.ProjectDTO, error)

Get 获取项目

func (*Project) GetAllProjects

func (p *Project) GetAllProjects() ([]apistructs.ProjectDTO, error)

GetAllProjects list all project

func (*Project) GetModelProject

func (p *Project) GetModelProject(projectID int64) (*model.Project, error)

GetModelProject 获取项目

func (*Project) GetMyProjectIDList

func (p *Project) GetMyProjectIDList(parentID int64, userID string) ([]uint64, 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) 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) ReferCluster

func (p *Project) ReferCluster(clusterName string) bool

ReferCluster 检查 cluster 是否被某个项目所使用

func (*Project) Update

func (p *Project) Update(projectID int64, 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(projectID int64, updateReq *apistructs.ProjectUpdateBody) error

UpdateWithEvent 更新项目 & 发送事件

Jump to

Keyboard shortcuts

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