Documentation
¶
Index ¶
- Constants
- func DetectProjectNetwork(ctx context.Context, dockerCLI command.Cli, suffix string) string
- func DownProject(ctx context.Context, dockerCLI command.Cli, projectName string) error
- func NewSandboxProject(pid, uid, gid int, buildContext, dockerfile, image string, allowExternal bool, ...) (*composetypes.Project, error)
- func NormalizeProjectName(name string) string
- func ProjectSandboxName(cwd string) string
- type CleanResult
- type ComposeExecutor
- func (e *ComposeExecutor) CleanStale(ctx context.Context) (CleanResult, error)
- func (e *ComposeExecutor) Down(ctx context.Context) error
- func (e *ComposeExecutor) IsRunning(ctx context.Context) (bool, error)
- func (e *ComposeExecutor) RunContainer(ctx context.Context, argv []string, env []string, stdin io.Reader, ...) (int, error)
- func (e *ComposeExecutor) StartBackground(ctx context.Context)
- func (e *ComposeExecutor) Up(ctx context.Context) error
- func (e *ComposeExecutor) WaitReady(ctx context.Context) error
Constants ¶
View Source
const SandboxServiceName = "workspace"
Variables ¶
This section is empty.
Functions ¶
func DetectProjectNetwork ¶
DetectProjectNetwork checks whether a Docker network named "<cwd-project>_<suffix>" exists. Returns the full network name if found, "" otherwise. If suffix is empty, "default" is used.
func DownProject ¶
DownProject stops and removes a compose project by name only. It needs no build context or project spec, so it can tear down a sandbox for any directory regardless of local config.
func NewSandboxProject ¶
func NormalizeProjectName ¶
NormalizeProjectName converts a directory name to a Docker Compose project name.
func ProjectSandboxName ¶
Types ¶
type CleanResult ¶
type ComposeExecutor ¶
type ComposeExecutor struct {
// contains filtered or unexported fields
}
func NewComposeExecutor ¶
func NewComposeExecutor(dockerCLI command.Cli, project *composetypes.Project) *ComposeExecutor
func (*ComposeExecutor) CleanStale ¶
func (e *ComposeExecutor) CleanStale(ctx context.Context) (CleanResult, error)
func (*ComposeExecutor) IsRunning ¶
func (e *ComposeExecutor) IsRunning(ctx context.Context) (bool, error)
func (*ComposeExecutor) RunContainer ¶
func (*ComposeExecutor) StartBackground ¶
func (e *ComposeExecutor) StartBackground(ctx context.Context)
StartBackground runs Up in a goroutine. Call WaitReady before issuing commands to ensure the sandbox is available.
Click to show internal directories.
Click to hide internal directories.