Documentation
¶
Index ¶
- func DefaultMounts(workspaceDirs []string) map[string]string
- func DeleteVMState() error
- func MountFlags(mounts map[string]string) []string
- func SaveVMState(s *VMState) error
- func TranslatePath(hostPath string, mounts map[string]string) string
- func TranslateVolumeSpec(spec string, mounts map[string]string) string
- type Manager
- type SharedVMRuntime
- func (s *SharedVMRuntime) BinaryPath() string
- func (s *SharedVMRuntime) ContainerExec(ctx context.Context, nameOrID string, args []string, interactive bool) error
- func (s *SharedVMRuntime) ContainerInspect(ctx context.Context, nameOrID string) ([]byte, error)
- func (s *SharedVMRuntime) ContainerList(ctx context.Context, all bool) ([]engine.ContainerInfo, error)
- func (s *SharedVMRuntime) ContainerLogs(ctx context.Context, nameOrID string, follow bool) error
- func (s *SharedVMRuntime) ContainerRemove(ctx context.Context, nameOrID string, force bool) error
- func (s *SharedVMRuntime) ContainerRun(ctx context.Context, args []string, interactive bool) error
- func (s *SharedVMRuntime) ContainerStart(ctx context.Context, nameOrID string) error
- func (s *SharedVMRuntime) ContainerStop(ctx context.Context, nameOrID string) error
- func (s *SharedVMRuntime) Exec(ctx context.Context, args ...string) ([]byte, []byte, error)
- func (s *SharedVMRuntime) ExecInteractive(ctx context.Context, args ...string) error
- func (s *SharedVMRuntime) ExecStream(ctx context.Context, args ...string) (io.ReadCloser, error)
- func (s *SharedVMRuntime) ImageBuild(ctx context.Context, args []string) error
- func (s *SharedVMRuntime) ImageList(ctx context.Context) ([]engine.ImageInfo, error)
- func (s *SharedVMRuntime) ImagePull(ctx context.Context, image string) error
- func (s *SharedVMRuntime) ImagePush(ctx context.Context, image string) error
- func (s *SharedVMRuntime) ImageRemove(ctx context.Context, image string) error
- func (s *SharedVMRuntime) NetworkConnect(ctx context.Context, network, container string) error
- func (s *SharedVMRuntime) NetworkCreate(ctx context.Context, name string) error
- func (s *SharedVMRuntime) NetworkDisconnect(ctx context.Context, network, container string) error
- func (s *SharedVMRuntime) NetworkInspect(ctx context.Context, name string) ([]byte, error)
- func (s *SharedVMRuntime) NetworkList(ctx context.Context) ([]engine.NetworkInfo, error)
- func (s *SharedVMRuntime) NetworkRemove(ctx context.Context, name string) error
- func (s *SharedVMRuntime) Validate() error
- func (s *SharedVMRuntime) VolumeCreate(ctx context.Context, name string) error
- func (s *SharedVMRuntime) VolumeInspect(ctx context.Context, name string) ([]byte, error)
- func (s *SharedVMRuntime) VolumeList(ctx context.Context) ([]engine.VolumeInfo, error)
- func (s *SharedVMRuntime) VolumeRemove(ctx context.Context, name string) error
- type VMState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultMounts ¶
DefaultMounts returns mount mappings from workspace dirs. Each host dir is mounted at /host<dir> inside the VM. e.g., /Users/adrian → /host/Users/adrian
func DeleteVMState ¶
func DeleteVMState() error
func MountFlags ¶
MountFlags returns -v flags for VM creation from the mount mapping.
func SaveVMState ¶
func TranslatePath ¶
TranslatePath converts a host-absolute path to its VM-internal path. Returns the original path if no mount covers it.
func TranslateVolumeSpec ¶
TranslateVolumeSpec rewrites a volume spec's host path. e.g., "/Users/me/app/src:/app/src" → "/host/Users/me/app/src:/app/src" Bind mounts (starting with / or .) are translated; named volumes are left alone.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles the lifecycle of the persistent shared VM.
func (*Manager) EnsureRunning ¶
EnsureRunning ensures the shared VM is running, creating it if needed.
type SharedVMRuntime ¶
type SharedVMRuntime struct {
// contains filtered or unexported fields
}
SharedVMRuntime implements engine.Runtime by proxying all operations into a persistent shared VM. Each method constructs a gocker CLI command and executes it via `container exec gocker-shared gocker <args>`.
func NewSharedVMRuntime ¶
func NewSharedVMRuntime(manager *Manager, apple engine.Runtime) *SharedVMRuntime
func (*SharedVMRuntime) BinaryPath ¶
func (s *SharedVMRuntime) BinaryPath() string
func (*SharedVMRuntime) ContainerExec ¶
func (*SharedVMRuntime) ContainerInspect ¶
func (*SharedVMRuntime) ContainerList ¶
func (s *SharedVMRuntime) ContainerList(ctx context.Context, all bool) ([]engine.ContainerInfo, error)
func (*SharedVMRuntime) ContainerLogs ¶
func (*SharedVMRuntime) ContainerRemove ¶
func (*SharedVMRuntime) ContainerRun ¶
func (*SharedVMRuntime) ContainerStart ¶
func (s *SharedVMRuntime) ContainerStart(ctx context.Context, nameOrID string) error
func (*SharedVMRuntime) ContainerStop ¶
func (s *SharedVMRuntime) ContainerStop(ctx context.Context, nameOrID string) error
func (*SharedVMRuntime) ExecInteractive ¶
func (s *SharedVMRuntime) ExecInteractive(ctx context.Context, args ...string) error
func (*SharedVMRuntime) ExecStream ¶
func (s *SharedVMRuntime) ExecStream(ctx context.Context, args ...string) (io.ReadCloser, error)
func (*SharedVMRuntime) ImageBuild ¶
func (s *SharedVMRuntime) ImageBuild(ctx context.Context, args []string) error
func (*SharedVMRuntime) ImagePull ¶
func (s *SharedVMRuntime) ImagePull(ctx context.Context, image string) error
func (*SharedVMRuntime) ImagePush ¶
func (s *SharedVMRuntime) ImagePush(ctx context.Context, image string) error
func (*SharedVMRuntime) ImageRemove ¶
func (s *SharedVMRuntime) ImageRemove(ctx context.Context, image string) error
func (*SharedVMRuntime) NetworkConnect ¶
func (s *SharedVMRuntime) NetworkConnect(ctx context.Context, network, container string) error
func (*SharedVMRuntime) NetworkCreate ¶
func (s *SharedVMRuntime) NetworkCreate(ctx context.Context, name string) error
func (*SharedVMRuntime) NetworkDisconnect ¶
func (s *SharedVMRuntime) NetworkDisconnect(ctx context.Context, network, container string) error
func (*SharedVMRuntime) NetworkInspect ¶
func (*SharedVMRuntime) NetworkList ¶
func (s *SharedVMRuntime) NetworkList(ctx context.Context) ([]engine.NetworkInfo, error)
func (*SharedVMRuntime) NetworkRemove ¶
func (s *SharedVMRuntime) NetworkRemove(ctx context.Context, name string) error
func (*SharedVMRuntime) Validate ¶
func (s *SharedVMRuntime) Validate() error
Validate checks that the Apple runtime exists. The VM itself is created lazily.
func (*SharedVMRuntime) VolumeCreate ¶
func (s *SharedVMRuntime) VolumeCreate(ctx context.Context, name string) error
func (*SharedVMRuntime) VolumeInspect ¶
func (*SharedVMRuntime) VolumeList ¶
func (s *SharedVMRuntime) VolumeList(ctx context.Context) ([]engine.VolumeInfo, error)
func (*SharedVMRuntime) VolumeRemove ¶
func (s *SharedVMRuntime) VolumeRemove(ctx context.Context, name string) error
type VMState ¶
type VMState struct {
Name string `json:"name"`
Status string `json:"status"` // running, stopped
Image string `json:"image"`
Created time.Time `json:"created"`
Mounts map[string]string `json:"mounts"` // host path -> VM path
}
VMState tracks the persistent shared VM.