workspaces

package
v0.13.0-alpha.6 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrWorkspaceAlreadyExists = errors.New("workspace already exists")
	ErrInvalidWorkspaceName   = errors.New("name is not a valid alphanumeric string")
	ErrWorkspaceNotFound      = errors.New("workspace not found")
	ErrProjectNotFound        = errors.New("project not found")
)

Functions

func IsInvalidWorkspaceName added in v0.12.1

func IsInvalidWorkspaceName(err error) bool

func IsProjectNotFound added in v0.12.1

func IsProjectNotFound(err error) bool

func IsWorkspaceAlreadyExists added in v0.12.1

func IsWorkspaceAlreadyExists(err error) bool

func IsWorkspaceNotFound added in v0.12.1

func IsWorkspaceNotFound(err error) bool

Types

type IWorkspaceService added in v0.12.0

type IWorkspaceService interface {
	CreateWorkspace(req dto.CreateWorkspaceRequest) (*workspace.Workspace, error)
	GetWorkspace(workspaceId string) (*dto.WorkspaceDTO, error)
	GetWorkspaceLogReader(workspaceId string) (io.Reader, error)
	ListWorkspaces(verbose bool) ([]dto.WorkspaceDTO, error)
	RemoveWorkspace(workspaceId string) error
	SetProjectState(workspaceId string, projectName string, state *workspace.ProjectState) (*workspace.Workspace, error)
	StartProject(workspaceId string, projectName string) error
	StartWorkspace(workspaceId string) error
	StopProject(workspaceId string, projectName string) error
	StopWorkspace(workspaceId string) error
}

func NewWorkspaceService

func NewWorkspaceService(config WorkspaceServiceConfig) IWorkspaceService

type WorkspaceService

type WorkspaceService struct {
	// contains filtered or unexported fields
}

func (*WorkspaceService) CreateWorkspace

func (*WorkspaceService) GetWorkspace

func (s *WorkspaceService) GetWorkspace(workspaceId string) (*dto.WorkspaceDTO, error)

func (*WorkspaceService) GetWorkspaceLogReader added in v0.12.0

func (s *WorkspaceService) GetWorkspaceLogReader(workspaceId string) (io.Reader, error)

func (*WorkspaceService) ListWorkspaces

func (s *WorkspaceService) ListWorkspaces(verbose bool) ([]dto.WorkspaceDTO, error)

func (*WorkspaceService) RemoveWorkspace

func (s *WorkspaceService) RemoveWorkspace(workspaceId string) error

func (*WorkspaceService) SetProjectState

func (s *WorkspaceService) SetProjectState(workspaceId, projectName string, state *workspace.ProjectState) (*workspace.Workspace, error)

func (*WorkspaceService) StartProject

func (s *WorkspaceService) StartProject(workspaceId, projectName string) error

func (*WorkspaceService) StartWorkspace

func (s *WorkspaceService) StartWorkspace(workspaceId string) error

func (*WorkspaceService) StopProject

func (s *WorkspaceService) StopProject(workspaceId, projectName string) error

func (*WorkspaceService) StopWorkspace

func (s *WorkspaceService) StopWorkspace(workspaceId string) error

type WorkspaceServiceConfig

type WorkspaceServiceConfig struct {
	WorkspaceStore                  workspace.Store
	TargetStore                     targetStore
	ContainerRegistryStore          containerregistry.Store
	ServerApiUrl                    string
	ServerUrl                       string
	Provisioner                     provisioner.IProvisioner
	DefaultProjectImage             string
	DefaultProjectUser              string
	DefaultProjectPostStartCommands []string
	ApiKeyService                   apikeys.IApiKeyService
	NewWorkspaceLogger              func(workspaceId string) logger.Logger
	NewProjectLogger                func(workspaceId, projectName string) logger.Logger
	NewWorkspaceLogReader           func(workspaceId string) (io.Reader, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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