Documentation ¶
Index ¶
- Constants
- Variables
- type CloudCodeService
- func (c *CloudCodeService) CreateAndStartWorkspace(req *reqtype.SpaceCreateOption, userId uint32, uid string) (*model.Space, error)
- func (c *CloudCodeService) CreateWorkspace(req *reqtype.SpaceCreateOption, userId uint32) (*model.Space, error)
- func (c *CloudCodeService) DeleteWorkspace(id uint32, uid string) error
- func (c *CloudCodeService) ListWorkspace(userId uint32, uid string) ([]model.Space, error)
- func (c *CloudCodeService) ModifyName(name string, id, userId uint32) error
- func (c *CloudCodeService) StartWorkspace(id, userId uint32, uid string) (*model.Space, error)
- func (c *CloudCodeService) StopWorkspace(sid, uid string) error
- type EmailConfig
- type EmailService
- type SpaceTmplService
- type StartFunc
- type UserService
Constants ¶
View Source
const ( CloudCodeNamespace = "cloud-ide" DefaultPodPort = 9999 MaxSpaceCount = 20 )
Variables ¶
View Source
var ( ErrReqParamInvalid = errors.New("request param invalid") ErrNameDuplicate = errors.New("name duplicate") ErrReachMaxSpaceCount = errors.New("reach max space count") ErrSpaceCreate = errors.New("space create failed") ErrSpaceStart = errors.New("space start failed") ErrSpaceAlreadyExist = errors.New("space already exist") ErrSpaceNotFound = errors.New("space not found") ErrResourceExhausted = errors.New("no adequate resource are available") )
View Source
var ( ErrWorkSpaceIsRunning = errors.New("workspace is running") ErrWorkSpaceIsNotRunning = errors.New("workspace is not running") )
View Source
var ( ErrEmailCodeIncorrect = errors.New("email code incorrect") ErrEmailAlreadyInUse = errors.New("this email had been registered") )
View Source
var ErrOtherSpaceIsRunning = errors.New("there is other space running")
View Source
var ErrUserDeleted = errors.New("user deleted")
View Source
var ErrWorkSpaceNotExist = errors.New("workspace is not exist")
Functions ¶
This section is empty.
Types ¶
type CloudCodeService ¶
type CloudCodeService struct {
// contains filtered or unexported fields
}
func NewCloudCodeService ¶
func NewCloudCodeService() *CloudCodeService
func (*CloudCodeService) CreateAndStartWorkspace ¶
func (c *CloudCodeService) CreateAndStartWorkspace(req *reqtype.SpaceCreateOption, userId uint32, uid string) (*model.Space, error)
CreateAndStartWorkspace 创建并且启动云工作空间
func (*CloudCodeService) CreateWorkspace ¶
func (c *CloudCodeService) CreateWorkspace(req *reqtype.SpaceCreateOption, userId uint32) (*model.Space, error)
CreateWorkspace 创建云工作空间, 只涉及数据库操作
func (*CloudCodeService) DeleteWorkspace ¶
func (c *CloudCodeService) DeleteWorkspace(id uint32, uid string) error
DeleteWorkspace 删除云工作空间
func (*CloudCodeService) ListWorkspace ¶
ListWorkspace 列出云工作空间
func (*CloudCodeService) ModifyName ¶
func (c *CloudCodeService) ModifyName(name string, id, userId uint32) error
func (*CloudCodeService) StartWorkspace ¶
StartWorkspace 启动云工作空间
func (*CloudCodeService) StopWorkspace ¶
func (c *CloudCodeService) StopWorkspace(sid, uid string) error
StopWorkspace 停止云工作空间
type EmailConfig ¶
type EmailConfig struct {
// contains filtered or unexported fields
}
type EmailService ¶
type EmailService struct {
// contains filtered or unexported fields
}
func NewEmailService ¶
func NewEmailService() *EmailService
func (*EmailService) Send ¶
func (e *EmailService) Send(addr string) error
func (*EmailService) Start ¶
func (e *EmailService) Start() error
type SpaceTmplService ¶
type SpaceTmplService struct {
// contains filtered or unexported fields
}
func NewSpaceTmplService ¶
func NewSpaceTmplService() *SpaceTmplService
func (*SpaceTmplService) GetAllSpec ¶
func (s *SpaceTmplService) GetAllSpec() ([]*model.SpaceSpec, error)
func (*SpaceTmplService) GetAllUsingTmpl ¶
func (s *SpaceTmplService) GetAllUsingTmpl() ([]*model.SpaceTemplate, []*model.TmplKind, error)
type StartFunc ¶
type StartFunc func(ctx context.Context, in *pb.WorkspaceInfo, opts ...grpc.CallOption) (*pb.WorkspaceRunningInfo, error)
type UserService ¶
type UserService struct {
// contains filtered or unexported fields
}
func NewUserService ¶
func NewUserService() *UserService
func (*UserService) CheckUsernameAvailable ¶
func (u *UserService) CheckUsernameAvailable(username string) bool
func (*UserService) Login ¶
func (u *UserService) Login(username, password string) (*model.User, error)
func (*UserService) UserRegister ¶
func (u *UserService) UserRegister(info *model.RegisterInfo) error
Click to show internal directories.
Click to hide internal directories.