lume

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: Apache-2.0, MIT Imports: 28 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package lume implements the compute.Backend seam over Lume on a Mac host.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is the Lume adapter used by compute.Service.

func New

func New(ctx context.Context, opts Options) (*Client, error)

New dials the Mac host over SSH and returns a Client.

func (*Client) AddACLRule

AddACLRule is unsupported on the Mac backend.

func (*Client) AttachNIC

AttachNIC is unsupported on the Mac backend.

func (*Client) BeginCreateInstance

func (c *Client) BeginCreateInstance(ctx context.Context, req compute.CreateInstance) (compute.PendingInstance, error)

BeginCreateInstance clones the catalog seed, pins machineIdentifier, and records the mapping first.

func (*Client) Close

func (c *Client) Close() error

Close closes the SSH tunnel and removes generated SSH config files.

func (*Client) CreateForward

CreateForward is unsupported on the Mac backend.

func (*Client) CreateNetwork

func (c *Client) CreateNetwork(context.Context, string, compute.Network) (compute.Network, error)

CreateNetwork is unsupported on the Mac backend.

func (*Client) CreateSandbox

func (c *Client) CreateSandbox(ctx context.Context, sandbox compute.Sandbox) error

CreateSandbox persists a versioned sandbox sidecar under the agentcompute home.

func (*Client) CreateSnapshot

func (c *Client) CreateSnapshot(ctx context.Context, ref compute.Ref, snapshot string) (err error)

CreateSnapshot clones a stopped guest to a collision-safe VM and restores prior running state.

func (*Client) DeleteFile

func (c *Client) DeleteFile(ctx context.Context, ref compute.Ref, path string) error

DeleteFile removes one literal guest path through SFTP.

func (*Client) DeleteInstance

func (c *Client) DeleteInstance(ctx context.Context, ref compute.Ref) error

DeleteInstance force-stops and deletes one guest and its snapshot VMs.

func (*Client) DeleteNetwork

func (c *Client) DeleteNetwork(context.Context, string, string) error

DeleteNetwork is unsupported on the Mac backend.

func (*Client) DeleteSandbox

func (c *Client) DeleteSandbox(ctx context.Context, name string) error

DeleteSandbox deletes exact mapped VMs then the sidecar. Prefix deletes are never used.

func (*Client) DeleteSnapshot

func (c *Client) DeleteSnapshot(ctx context.Context, ref compute.Ref, snapshot string) error

DeleteSnapshot deletes one snapshot VM by its exact mapped name.

func (*Client) DetachNIC

func (c *Client) DetachNIC(context.Context, compute.Ref, string) error

DetachNIC is unsupported on the Mac backend.

func (*Client) Exec

func (c *Client) Exec(ctx context.Context, req compute.ExecRequest, stdout, stderr io.Writer) (int64, error)

Exec runs a guest command and drains stdout/stderr. Cancellation kills the ssh process group and then waits a bounded teardown.

func (*Client) ExtendSandbox

func (c *Client) ExtendSandbox(ctx context.Context, name string, expires time.Time) (compute.Sandbox, error)

ExtendSandbox writes a new expiry into the sandbox sidecar.

func (*Client) GetInstance

func (c *Client) GetInstance(ctx context.Context, ref compute.Ref) (compute.Instance, error)

GetInstance returns observed Lume guest state for a mapped instance.

func (*Client) GetNetwork

func (c *Client) GetNetwork(ctx context.Context, sandbox, _ string) (compute.Network, error)

GetNetwork reports that Mac sandboxes have no managed networks.

func (*Client) GetSandbox

func (c *Client) GetSandbox(ctx context.Context, name string) (compute.Sandbox, error)

GetSandbox returns one sandbox sidecar.

func (*Client) GetSandboxImage

func (c *Client) GetSandboxImage(context.Context, string, string) (compute.CatalogImage, error)

GetSandboxImage is unsupported on the Mac backend.

func (*Client) InstanceForward

func (c *Client) InstanceForward(context.Context, compute.Ref, int64, string) (compute.Forward, error)

InstanceForward is unsupported on the Mac backend.

func (*Client) ListInstances

func (c *Client) ListInstances(ctx context.Context, sandbox string) ([]compute.Instance, error)

ListInstances returns guests recorded for a sandbox that still exist on the host.

func (*Client) ListNetworks

func (c *Client) ListNetworks(ctx context.Context, sandbox string) ([]compute.Network, error)

ListNetworks returns no agent-facing networks; GetSandbox still succeeds.

func (*Client) ListSandboxes

func (c *Client) ListSandboxes(ctx context.Context) ([]compute.Sandbox, error)

ListSandboxes returns sandboxes from host sidecars.

func (*Client) ListSnapshots

func (c *Client) ListSnapshots(ctx context.Context, ref compute.Ref) ([]compute.Snapshot, error)

ListSnapshots returns snapshots recorded for one guest.

func (*Client) OpenExec

func (c *Client) OpenExec(ctx context.Context, req compute.ExecRequest) (io.ReadWriteCloser, error)

OpenExec starts a guest command and returns attached stdin/stdout. Close kills the ssh process group and reaps it. The start context does not bound a successful stream.

func (*Client) PeerNetworks

func (c *Client) PeerNetworks(context.Context, string, string, string) error

PeerNetworks is unsupported on the Mac backend.

func (*Client) PublishInstance

func (c *Client) PublishInstance(context.Context, compute.Ref, string) (string, error)

PublishInstance is unsupported on the Mac backend.

func (*Client) ReadBinaryFile

func (c *Client) ReadBinaryFile(ctx context.Context, ref compute.Ref, path string) (io.ReadCloser, error)

ReadBinaryFile opens a guest file without passing bytes through exec or text conversion. The caller must close the stream and enforce its own byte bound.

func (*Client) ReadFile

ReadFile pulls a bounded guest file through SFTP.

func (*Client) RemoveACLRule

func (c *Client) RemoveACLRule(context.Context, string, string, string) error

RemoveACLRule is unsupported on the Mac backend.

func (*Client) RestartInstance

func (c *Client) RestartInstance(ctx context.Context, ref compute.Ref, _ bool) (compute.Instance, error)

RestartInstance stops a guest if needed, then starts it with the same capacity rules as StartInstance.

func (*Client) RestoreSnapshot

func (c *Client) RestoreSnapshot(ctx context.Context, ref compute.Ref, snapshot string) error

RestoreSnapshot clones a snapshot VM over the instance mapping without deleting the seed.

func (*Client) StartInstance

func (c *Client) StartInstance(ctx context.Context, ref compute.Ref, _ bool) (compute.Instance, error)

StartInstance starts a guest, waits until SSH and the Driver are agent-facing, and returns Running.

func (*Client) StopInstance

func (c *Client) StopInstance(ctx context.Context, ref compute.Ref, _ bool) (compute.Instance, error)

StopInstance stops a guest and waits until it is stopped.

func (*Client) WaitInstance

func (c *Client) WaitInstance(ctx context.Context, req compute.WaitRequest) (compute.WaitResult, error)

WaitInstance polls until a readiness stage is reached.

func (*Client) WriteFile

WriteFile writes a guest file through SFTP, applying requested permissions before its contents.

type Options

type Options struct {
	// Host is the Mac hostname or IP, without a user. A host:port value
	// selects a non-default SSH port.
	Host string

	// IdentityFile is the server-to-host private key path.
	IdentityFile string

	// KnownHostsFile verifies the Mac host key.
	KnownHostsFile string

	// GuestKnownHostsFile verifies guest keys by seed HostKeyAlias.
	GuestKnownHostsFile string

	// GuestKeys maps catalog image name to a server-side guest private key path.
	GuestKeys map[string]string
}

Options configures a Lume client.

Jump to

Keyboard shortcuts

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