Documentation
¶
Index ¶
- Variables
- func GetGitspaceContainerName(config types.GitspaceConfig) string
- func GetUserHomeDir(userIdentifier string) string
- type EmbeddedDockerOrchestrator
- func (e *EmbeddedDockerOrchestrator) CreateAndStartGitspace(ctx context.Context, gitspaceConfig types.GitspaceConfig, ...) (*StartResponse, error)
- func (e *EmbeddedDockerOrchestrator) Status(_ context.Context, _ types.Infrastructure) error
- func (e *EmbeddedDockerOrchestrator) StopAndRemoveGitspace(ctx context.Context, gitspaceConfig types.GitspaceConfig, ...) error
- func (e *EmbeddedDockerOrchestrator) StopGitspace(ctx context.Context, gitspaceConfig types.GitspaceConfig, ...) error
- func (e *EmbeddedDockerOrchestrator) StreamLogs(_ context.Context, _ types.GitspaceConfig, _ types.Infrastructure) (string, error)
- type Orchestrator
- type StartResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var WireSet = wire.NewSet( ProvideEmbeddedDockerOrchestrator, )
Functions ¶
func GetGitspaceContainerName ¶
func GetGitspaceContainerName(config types.GitspaceConfig) string
func GetUserHomeDir ¶
Types ¶
type EmbeddedDockerOrchestrator ¶
type EmbeddedDockerOrchestrator struct {
// contains filtered or unexported fields
}
func (*EmbeddedDockerOrchestrator) CreateAndStartGitspace ¶
func (e *EmbeddedDockerOrchestrator) CreateAndStartGitspace( ctx context.Context, gitspaceConfig types.GitspaceConfig, infra types.Infrastructure, resolvedRepoDetails scm.ResolvedDetails, defaultBaseImage string, ideService ide.IDE, ) (*StartResponse, error)
CreateAndStartGitspace starts an exited container and starts a new container if the container is removed. If the container is newly created, it clones the code, sets up the IDE and executes the postCreateCommand. It returns the container ID, name and ports used. It returns an error if the container is not running, exited or removed.
func (*EmbeddedDockerOrchestrator) Status ¶
func (e *EmbeddedDockerOrchestrator) Status(_ context.Context, _ types.Infrastructure) error
Status is NOOP for EmbeddedDockerOrchestrator as the docker host is verified by the infra provisioner.
func (*EmbeddedDockerOrchestrator) StopAndRemoveGitspace ¶
func (e *EmbeddedDockerOrchestrator) StopAndRemoveGitspace( ctx context.Context, gitspaceConfig types.GitspaceConfig, infra types.Infrastructure, ) error
StopAndRemoveGitspace stops the container if not stopped and removes it. If the container is already removed, it returns.
func (*EmbeddedDockerOrchestrator) StopGitspace ¶
func (e *EmbeddedDockerOrchestrator) StopGitspace( ctx context.Context, gitspaceConfig types.GitspaceConfig, infra types.Infrastructure, ) error
StopGitspace stops a container. If it is removed, it returns an error.
func (*EmbeddedDockerOrchestrator) StreamLogs ¶
func (e *EmbeddedDockerOrchestrator) StreamLogs( _ context.Context, _ types.GitspaceConfig, _ types.Infrastructure) (string, error)
type Orchestrator ¶
type Orchestrator interface {
// CreateAndStartGitspace starts an exited container and starts a new container if the container is removed.
// If the container is newly created, it clones the code, sets up the IDE and executes the postCreateCommand.
// It returns the container ID, name and ports used.
CreateAndStartGitspace(
ctx context.Context,
gitspaceConfig types.GitspaceConfig,
infra types.Infrastructure,
resolvedDetails scm.ResolvedDetails,
defaultBaseImage string,
ideService ide.IDE,
) (*StartResponse, error)
// StopGitspace stops the gitspace container.
StopGitspace(ctx context.Context, config types.GitspaceConfig, infra types.Infrastructure) error
// StopAndRemoveGitspace stops and removes the gitspace container.
StopAndRemoveGitspace(ctx context.Context, config types.GitspaceConfig, infra types.Infrastructure) error
// Status checks if the infra is reachable and ready to orchestrate containers.
Status(ctx context.Context, infra types.Infrastructure) error
// StreamLogs is used to fetch gitspace's start/stop logs from the container orchestrator.
StreamLogs(ctx context.Context, gitspaceConfig types.GitspaceConfig, infra types.Infrastructure) (string, error)
}
func NewEmbeddedDockerOrchestrator ¶
func NewEmbeddedDockerOrchestrator( dockerClientFactory *infraprovider.DockerClientFactory, statefulLogger *logutil.StatefulLogger, gitService git.Service, userService user.Service, ) Orchestrator
func ProvideEmbeddedDockerOrchestrator ¶
func ProvideEmbeddedDockerOrchestrator( dockerClientFactory *infraprovider.DockerClientFactory, statefulLogger *logutil.StatefulLogger, gitService git.Service, userService user.Service, ) Orchestrator
Click to show internal directories.
Click to hide internal directories.