Documentation ¶
Index ¶
- Constants
- type WorkSpaceService
- func (s *WorkSpaceService) CreateSpace(ctx context.Context, info *pb.RequestCreate) (*pb.ResponseCreate, error)
- func (s *WorkSpaceService) DeleteSpace(ctx context.Context, req *pb.RequestDelete) (*pb.ResponseDelete, error)
- func (s *WorkSpaceService) RunningWorkspaces(ctx context.Context, req *pb.RequestRunningWorkspaces) (*pb.ResponseRunningWorkspace, error)
- func (s *WorkSpaceService) StartSpace(ctx context.Context, req *pb.RequestStart) (*pb.ResponseStart, error)
- func (s *WorkSpaceService) StopSpace(ctx context.Context, req *pb.RequestStop) (*pb.ResponseStop, error)
Constants ¶
View Source
const ( WorkspaceAlreadyExist = "workspace already exist" WorkspaceNotExist = "workspace not exist" WorkspaceCreateFailed = "create workspace error" WorkspaceStartFailed = "start workspace error" WorkspaceStopFailed = "stop workspace error" WorkspaceDeleteFailed = "delete workspace error" )
View Source
const WorkspaceNameFormat = "ws-%s-%s"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WorkSpaceService ¶
type WorkSpaceService struct { pb.UnimplementedCloudIdeServiceServer // contains filtered or unexported fields }
func NewWorkSpaceService ¶
func (*WorkSpaceService) CreateSpace ¶
func (s *WorkSpaceService) CreateSpace(ctx context.Context, info *pb.RequestCreate) (*pb.ResponseCreate, error)
CreateSpace 创建并且启动Workspace,将Operation字段置为"Start",当Workspace被创建时,PVC和Pod也会被创建 该接口仅被用于第一次创建工作空间并且启动
func (*WorkSpaceService) DeleteSpace ¶
func (s *WorkSpaceService) DeleteSpace(ctx context.Context, req *pb.RequestDelete) (*pb.ResponseDelete, error)
DeleteSpace 只需要将workspace删除即可,controller会负责删除对应的Pod和PVC
func (*WorkSpaceService) RunningWorkspaces ¶
func (s *WorkSpaceService) RunningWorkspaces(ctx context.Context, req *pb.RequestRunningWorkspaces) (*pb.ResponseRunningWorkspace, error)
RunningWorkspaces 获取运行中的Workspace
func (*WorkSpaceService) StartSpace ¶
func (s *WorkSpaceService) StartSpace(ctx context.Context, req *pb.RequestStart) (*pb.ResponseStart, error)
StartSpace 启动Workspace
func (*WorkSpaceService) StopSpace ¶
func (s *WorkSpaceService) StopSpace(ctx context.Context, req *pb.RequestStop) (*pb.ResponseStop, error)
StopSpace 停止Workspace,只需要删除对应的Pod,因此修改Workspace的操作为Stop即可
Click to show internal directories.
Click to hide internal directories.