Documentation ¶
Index ¶
- Variables
- func IsInvalidWorkspaceName(err error) bool
- func IsProjectNotFound(err error) bool
- func IsWorkspaceAlreadyExists(err error) bool
- func IsWorkspaceNotFound(err error) bool
- type IWorkspaceService
- type WorkspaceService
- func (s *WorkspaceService) CreateWorkspace(ctx context.Context, req dto.CreateWorkspaceDTO) (*workspace.Workspace, error)
- func (s *WorkspaceService) ForceRemoveWorkspace(ctx context.Context, workspaceId string) error
- func (s *WorkspaceService) GetProjectLogReader(workspaceId, projectName string) (io.Reader, error)
- func (s *WorkspaceService) GetWorkspace(ctx context.Context, workspaceId string, verbose bool) (*dto.WorkspaceDTO, error)
- func (s *WorkspaceService) GetWorkspaceLogReader(workspaceId string) (io.Reader, error)
- func (s *WorkspaceService) ListWorkspaces(ctx context.Context, verbose bool) ([]dto.WorkspaceDTO, error)
- func (s *WorkspaceService) RemoveWorkspace(ctx context.Context, workspaceId string) error
- func (s *WorkspaceService) SetProjectState(workspaceId, projectName string, state *project.ProjectState) (*workspace.Workspace, error)
- func (s *WorkspaceService) StartProject(ctx context.Context, workspaceId, projectName string) error
- func (s *WorkspaceService) StartWorkspace(ctx context.Context, workspaceId string) error
- func (s *WorkspaceService) StopProject(ctx context.Context, workspaceId, projectName string) error
- func (s *WorkspaceService) StopWorkspace(ctx context.Context, workspaceId string) error
- type WorkspaceServiceConfig
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 IsProjectNotFound ¶ added in v0.12.1
func IsWorkspaceAlreadyExists ¶ added in v0.12.1
func IsWorkspaceNotFound ¶ added in v0.12.1
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 (s *WorkspaceService) CreateWorkspace(ctx context.Context, req dto.CreateWorkspaceDTO) (*workspace.Workspace, error)
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 }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.