workspaces

package
v0.52.1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

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

Types

type WorkspaceEnvVarParams added in v0.52.0

type WorkspaceEnvVarParams struct {
	ApiUrl           string
	ServerUrl        string
	ServerVersion    string
	ClientId         string
	TelemetryEnabled bool
}

type WorkspaceService

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

func (*WorkspaceService) Create added in v0.52.0

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 (*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 (s *WorkspaceService) GetWorkspaceLogReader(ctx context.Context, workspaceId string) (io.Reader, error)

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 (*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
}

Jump to

Keyboard shortcuts

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