workspaces

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: Apache-2.0 Imports: 27 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")
	ErrInvalidProjectConfig   = errors.New("project config is invalid")
)

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(ctx context.Context, req dto.CreateWorkspaceDTO) (*workspace.Workspace, error)
	GetWorkspace(ctx context.Context, workspaceId string, verbose bool) (*dto.WorkspaceDTO, error)
	GetWorkspaceLogReader(workspaceId string) (io.Reader, error)
	GetProjectLogReader(workspaceId, projectName string) (io.Reader, error)
	ListWorkspaces(ctx context.Context, verbose bool) ([]dto.WorkspaceDTO, error)
	RemoveWorkspace(ctx context.Context, workspaceId string) error
	ForceRemoveWorkspace(ctx context.Context, workspaceId string) error
	SetProjectState(workspaceId string, projectName string, state *project.ProjectState) (*workspace.Workspace, error)
	StartProject(ctx context.Context, workspaceId string, projectName string) error
	StartWorkspace(ctx context.Context, workspaceId string) error
	StopProject(ctx context.Context, workspaceId string, projectName string) error
	StopWorkspace(ctx context.Context, 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(ctx context.Context, 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(ctx context.Context, workspaceId string, verbose bool) (*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(ctx context.Context, verbose bool) ([]dto.WorkspaceDTO, error)

func (*WorkspaceService) RemoveWorkspace

func (s *WorkspaceService) RemoveWorkspace(ctx context.Context, workspaceId string) error

func (*WorkspaceService) SetProjectState

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

func (*WorkspaceService) StartProject

func (s *WorkspaceService) StartProject(ctx context.Context, workspaceId, projectName string) error

func (*WorkspaceService) StartWorkspace

func (s *WorkspaceService) StartWorkspace(ctx context.Context, workspaceId string) error

func (*WorkspaceService) StopProject

func (s *WorkspaceService) StopProject(ctx context.Context, workspaceId, projectName string) error

func (*WorkspaceService) StopWorkspace

func (s *WorkspaceService) StopWorkspace(ctx context.Context, workspaceId string) error

type WorkspaceServiceConfig

type WorkspaceServiceConfig struct {
	WorkspaceStore           workspace.Store
	TargetStore              targetStore
	ContainerRegistryService containerregistries.IContainerRegistryService
	BuildService             builds.IBuildService
	ProjectConfigService     projectconfig.IProjectConfigService
	ServerApiUrl             string
	ServerUrl                string
	Provisioner              provisioner.IProvisioner
	DefaultProjectImage      string
	DefaultProjectUser       string
	ApiKeyService            apikeys.IApiKeyService
	LoggerFactory            logs.LoggerFactory
	GitProviderService       gitproviders.IGitProviderService
	TelemetryService         telemetry.TelemetryService
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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