service

package
v0.0.0-...-b9d6e19 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

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 NewWorkSpaceService(c client.Client, logger logr.Logger, waiter notifier.Waiter, namespace string) *WorkSpaceService

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

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即可

Jump to

Keyboard shortcuts

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