service

package
v0.0.0-...-a0dc9d2 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

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

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

StartSpace 启动Workspace

func (*WorkSpaceService) StopSpace

func (s *WorkSpaceService) StopSpace(ctx context.Context, option *pb.QueryOption) (*pb.Response, error)

StopSpace 停止Workspace,只需要删除对应的Pod,因此修改Workspace的操作为Stop即可

Jump to

Keyboard shortcuts

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