workspaces

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2024 License: Apache-2.0 Imports: 19 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")
	ErrInvalidProjectName     = errors.New("project name is not valid. Only [a-zA-Z0-9-_.] are allowed")
)

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)
	GetProjectLogReader(workspaceId, projectName string) (io.Reader, error)
	ListWorkspaces(verbose bool) ([]dto.WorkspaceDTO, error)
	RemoveWorkspace(workspaceId string) error
	ForceRemoveWorkspace(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) ForceRemoveWorkspace added in v0.19.0

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

ForceRemoveWorkspace ignores provider errors and makes sure the workspace is removed from storage.

func (*WorkspaceService) GetProjectLogReader added in v0.13.0

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

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
	ContainerRegistryService        containerregistries.IContainerRegistryService
	ServerApiUrl                    string
	ServerUrl                       string
	Provisioner                     provisioner.IProvisioner
	DefaultProjectImage             string
	DefaultProjectUser              string
	DefaultProjectPostStartCommands []string
	ApiKeyService                   apikeys.IApiKeyService
	LoggerFactory                   logs.LoggerFactory
	GitProviderService              gitproviders.IGitProviderService
	BuilderFactory                  builder.IBuilderFactory
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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