Documentation ¶
Index ¶
- Constants
- Variables
- type WorkSpaceService
- func (s *WorkSpaceService) CreateSpace(ctx context.Context, info *pb.WorkspaceInfo) (*pb.WorkspaceRunningInfo, error)
- func (s *WorkSpaceService) DeleteSpace(ctx context.Context, option *pb.QueryOption) (*pb.Response, error)
- func (s *WorkSpaceService) GetPodSpaceInfo(ctx context.Context, option *pb.QueryOption) (*pb.WorkspaceRunningInfo, error)
- func (s *WorkSpaceService) GetPodSpaceStatus(ctx context.Context, option *pb.QueryOption) (*pb.WorkspaceStatus, error)
- func (s *WorkSpaceService) StartSpace(ctx context.Context, info *pb.WorkspaceInfo) (*pb.WorkspaceRunningInfo, error)
- func (s *WorkSpaceService) StopSpace(ctx context.Context, option *pb.QueryOption) (*pb.Response, error)
Constants ¶
View Source
const ( PodNotExist int32 = iota PodExist )
Variables ¶
View Source
var ( WorkspaceAlreadyExist = "workspace already exist" WorkspaceCreateFailed = "create workspace error" WorkspaceNotExist = "workspace not exist" WorkspaceStartFailed = "start workspace error" WorkspaceDeleteFailed = "delete workspace error" )
View Source
var ( EmptyWorkspaceRunningInfo = &pb.WorkspaceRunningInfo{} EmptyResponse = &pb.Response{} EmptyWorkspaceInfo = &pb.WorkspaceInfo{} EmptyWorkspaceStatus = &pb.WorkspaceStatus{} )
Functions ¶
This section is empty.
Types ¶
type WorkSpaceService ¶
type WorkSpaceService struct {
// contains filtered or unexported fields
}
func NewWorkSpaceService ¶
func NewWorkSpaceService(c client.Client) *WorkSpaceService
func (*WorkSpaceService) CreateSpace ¶
func (s *WorkSpaceService) CreateSpace(ctx context.Context, info *pb.WorkspaceInfo) (*pb.WorkspaceRunningInfo, error)
CreateSpace 创建并且启动Workspace,将Operation字段置为"Start",当Workspace被创建时,PVC和Pod也会被创建
func (*WorkSpaceService) DeleteSpace ¶
func (s *WorkSpaceService) DeleteSpace(ctx context.Context, option *pb.QueryOption) (*pb.Response, error)
DeleteSpace 只需要将workspace删除即可,controller会负责删除对应的Pod和PVC
func (*WorkSpaceService) GetPodSpaceInfo ¶
func (s *WorkSpaceService) GetPodSpaceInfo(ctx context.Context, option *pb.QueryOption) (*pb.WorkspaceRunningInfo, error)
func (*WorkSpaceService) GetPodSpaceStatus ¶
func (s *WorkSpaceService) GetPodSpaceStatus(ctx context.Context, option *pb.QueryOption) (*pb.WorkspaceStatus, error)
func (*WorkSpaceService) StartSpace ¶
func (s *WorkSpaceService) StartSpace(ctx context.Context, info *pb.WorkspaceInfo) (*pb.WorkspaceRunningInfo, error)
StartSpace 启动Workspace
func (*WorkSpaceService) StopSpace ¶
func (s *WorkSpaceService) StopSpace(ctx context.Context, option *pb.QueryOption) (*pb.Response, error)
StopSpace 停止Workspace,只需要删除对应的Pod,因此修改Workspace的操作为Stop即可
Click to show internal directories.
Click to hide internal directories.