Documentation
¶
Index ¶
- func GetWorkspaceEnvVars(workspace *models.Workspace, params WorkspaceEnvVarParams) map[string]string
- func NewWorkspaceService(config WorkspaceServiceConfig) services.IWorkspaceService
- type WorkspaceEnvVarParams
- type WorkspaceService
- func (s *WorkspaceService) Create(ctx context.Context, req services.CreateWorkspaceDTO) (*services.WorkspaceDTO, error)
- func (s *WorkspaceService) Delete(ctx context.Context, workspaceId string) error
- func (s *WorkspaceService) Find(ctx context.Context, workspaceId string, ...) (*services.WorkspaceDTO, error)
- func (s *WorkspaceService) ForceDelete(ctx context.Context, workspaceId string) error
- func (s *WorkspaceService) GetWorkspaceLogReader(ctx context.Context, workspaceId string) (io.Reader, error)
- func (s *WorkspaceService) GetWorkspaceLogWriter(ctx context.Context, workspaceId string) (io.WriteCloser, error)
- func (s *WorkspaceService) List(ctx context.Context, params services.WorkspaceRetrievalParams) ([]services.WorkspaceDTO, error)
- func (s *WorkspaceService) Restart(ctx context.Context, workspaceId string) error
- func (s *WorkspaceService) Start(ctx context.Context, workspaceId string) error
- func (s *WorkspaceService) Stop(ctx context.Context, workspaceId string) error
- func (s *WorkspaceService) UpdateLabels(ctx context.Context, workspaceId string, labels map[string]string) (*services.WorkspaceDTO, error)
- func (s *WorkspaceService) UpdateLastJob(ctx context.Context, workspaceId, jobId string) error
- func (s *WorkspaceService) UpdateMetadata(ctx context.Context, workspaceId string, metadata *models.WorkspaceMetadata) (*models.WorkspaceMetadata, error)
- func (s *WorkspaceService) UpdateProviderMetadata(ctx context.Context, workspaceId, metadata string) error
- type WorkspaceServiceConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetWorkspaceEnvVars ¶ added in v0.52.0
func GetWorkspaceEnvVars(workspace *models.Workspace, params WorkspaceEnvVarParams) map[string]string
func NewWorkspaceService ¶
func NewWorkspaceService(config WorkspaceServiceConfig) services.IWorkspaceService
Types ¶
type WorkspaceEnvVarParams ¶ added in v0.52.0
type WorkspaceService ¶
type WorkspaceService struct {
// contains filtered or unexported fields
}
func (*WorkspaceService) Create ¶ added in v0.52.0
func (s *WorkspaceService) Create(ctx context.Context, req services.CreateWorkspaceDTO) (*services.WorkspaceDTO, error)
func (*WorkspaceService) Delete ¶ added in v0.52.0
func (s *WorkspaceService) Delete(ctx context.Context, workspaceId string) error
func (*WorkspaceService) Find ¶ added in v0.52.0
func (s *WorkspaceService) Find(ctx context.Context, workspaceId string, params services.WorkspaceRetrievalParams) (*services.WorkspaceDTO, error)
func (*WorkspaceService) ForceDelete ¶ added in v0.52.0
func (s *WorkspaceService) ForceDelete(ctx context.Context, workspaceId string) error
ForceDelete ignores provider errors and makes sure the workspace is removed from storage.
func (*WorkspaceService) GetWorkspaceLogReader ¶ added in v0.12.0
func (*WorkspaceService) GetWorkspaceLogWriter ¶ added in v0.52.0
func (s *WorkspaceService) GetWorkspaceLogWriter(ctx context.Context, workspaceId string) (io.WriteCloser, error)
func (*WorkspaceService) List ¶ added in v0.52.0
func (s *WorkspaceService) List(ctx context.Context, params services.WorkspaceRetrievalParams) ([]services.WorkspaceDTO, error)
func (*WorkspaceService) Restart ¶ added in v0.52.0
func (s *WorkspaceService) Restart(ctx context.Context, workspaceId string) error
func (*WorkspaceService) Start ¶ added in v0.52.0
func (s *WorkspaceService) Start(ctx context.Context, workspaceId string) error
func (*WorkspaceService) Stop ¶ added in v0.52.0
func (s *WorkspaceService) Stop(ctx context.Context, workspaceId string) error
func (*WorkspaceService) UpdateLabels ¶ added in v0.52.0
func (s *WorkspaceService) UpdateLabels(ctx context.Context, workspaceId string, labels map[string]string) (*services.WorkspaceDTO, error)
func (*WorkspaceService) UpdateLastJob ¶ added in v0.52.0
func (s *WorkspaceService) UpdateLastJob(ctx context.Context, workspaceId, jobId string) error
func (*WorkspaceService) UpdateMetadata ¶ added in v0.52.0
func (s *WorkspaceService) UpdateMetadata(ctx context.Context, workspaceId string, metadata *models.WorkspaceMetadata) (*models.WorkspaceMetadata, error)
func (*WorkspaceService) UpdateProviderMetadata ¶ added in v0.52.0
func (s *WorkspaceService) UpdateProviderMetadata(ctx context.Context, workspaceId, metadata string) error
type WorkspaceServiceConfig ¶
type WorkspaceServiceConfig struct { WorkspaceStore stores.WorkspaceStore WorkspaceMetadataStore stores.WorkspaceMetadataStore FindTarget func(ctx context.Context, targetId string) (*models.Target, error) FindContainerRegistry func(ctx context.Context, image string, envVars map[string]string) *models.ContainerRegistry FindCachedBuild func(ctx context.Context, w *models.Workspace) (*models.CachedBuild, error) CreateApiKey func(ctx context.Context, name string) (string, error) DeleteApiKey func(ctx context.Context, name string) error ListGitProviderConfigs func(ctx context.Context, repoUrl string) ([]*models.GitProviderConfig, error) FindGitProviderConfig func(ctx context.Context, id string) (*models.GitProviderConfig, error) GetLastCommitSha func(ctx context.Context, repo *gitprovider.GitRepository) (string, error) CreateJob func(ctx context.Context, workspaceId string, runnerId string, action models.JobAction) error TrackTelemetryEvent func(event telemetry.Event, clientId string) error LoggerFactory logs.ILoggerFactory ServerApiUrl string ServerUrl string ServerVersion string DefaultWorkspaceImage string DefaultWorkspaceUser string }
Click to show internal directories.
Click to hide internal directories.