Documentation
¶
Overview ¶
Package sandboxlifecycle decides whether the Docker sandbox needs starting and, when it does, brings it up — reporting whether the caller now owns it. The ownership signal lets callers tear down only the sandbox they started.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Ensure ¶
Ensure makes sb running. If it is already running, Ensure does nothing and reports startedByUs=false (the caller must not tear it down). If it was not running, Ensure brings it up and applies the network policy, reporting startedByUs=true. Any failure is returned and startedByUs is false.
func NewExecutor ¶
func NewExecutor(ctx context.Context, cfg *config.Config) (*container.ComposeExecutor, string, func(), error)
NewExecutor connects to Docker and builds a compose executor for cfg's sandbox project (named deterministically from the current directory). The returned cleanup closes the Docker client and must be called by the caller.
Types ¶
type Result ¶
type Result struct {
Executor *container.ComposeExecutor
ProjectName string
StartedByUs bool
// contains filtered or unexported fields
}
Result carries the outcome of EnsureUp: the executor to run/tear down the sandbox, its project name, and whether this call started it.
func EnsureUp ¶
EnsureUp builds the executor for cfg and ensures the sandbox is running. On any failure it closes the Docker client and returns the error; Claude must not be launched in that case.
func (*Result) Close ¶
func (r *Result) Close()
Close releases the Docker client. Safe to call multiple times.