Documentation
¶
Overview ¶
Package lume implements the compute.Backend seam over Lume on a Mac host.
Index ¶
- type Client
- func (c *Client) AddACLRule(context.Context, string, string, compute.ACLRule) (compute.ACLRule, error)
- func (c *Client) AttachNIC(context.Context, compute.Ref, string, string, string, string) (compute.NIC, error)
- func (c *Client) BeginCreateInstance(ctx context.Context, req compute.CreateInstance) (compute.PendingInstance, error)
- func (c *Client) Close() error
- func (c *Client) CreateForward(context.Context, string, string, compute.Ref, int64, int64, string) (compute.Forward, error)
- func (c *Client) CreateNetwork(context.Context, string, compute.Network) (compute.Network, error)
- func (c *Client) CreateSandbox(ctx context.Context, sandbox compute.Sandbox) error
- func (c *Client) CreateSnapshot(ctx context.Context, ref compute.Ref, snapshot string) (err error)
- func (c *Client) DeleteFile(ctx context.Context, ref compute.Ref, path string) error
- func (c *Client) DeleteInstance(ctx context.Context, ref compute.Ref) error
- func (c *Client) DeleteNetwork(context.Context, string, string) error
- func (c *Client) DeleteSandbox(ctx context.Context, name string) error
- func (c *Client) DeleteSnapshot(ctx context.Context, ref compute.Ref, snapshot string) error
- func (c *Client) DetachNIC(context.Context, compute.Ref, string) error
- func (c *Client) Exec(ctx context.Context, req compute.ExecRequest, stdout, stderr io.Writer) (int64, error)
- func (c *Client) ExtendSandbox(ctx context.Context, name string, expires time.Time) (compute.Sandbox, error)
- func (c *Client) GetInstance(ctx context.Context, ref compute.Ref) (compute.Instance, error)
- func (c *Client) GetNetwork(ctx context.Context, sandbox, _ string) (compute.Network, error)
- func (c *Client) GetSandbox(ctx context.Context, name string) (compute.Sandbox, error)
- func (c *Client) GetSandboxImage(context.Context, string, string) (compute.CatalogImage, error)
- func (c *Client) InstanceForward(context.Context, compute.Ref, int64, string) (compute.Forward, error)
- func (c *Client) ListInstances(ctx context.Context, sandbox string) ([]compute.Instance, error)
- func (c *Client) ListNetworks(ctx context.Context, sandbox string) ([]compute.Network, error)
- func (c *Client) ListSandboxes(ctx context.Context) ([]compute.Sandbox, error)
- func (c *Client) ListSnapshots(ctx context.Context, ref compute.Ref) ([]compute.Snapshot, error)
- func (c *Client) OpenExec(ctx context.Context, req compute.ExecRequest) (io.ReadWriteCloser, error)
- func (c *Client) PeerNetworks(context.Context, string, string, string) error
- func (c *Client) PinSandbox(ctx context.Context, name string, pinned bool, subject string, since time.Time) (compute.Sandbox, error)
- func (c *Client) PublishInstance(context.Context, compute.Ref, string) (string, error)
- func (c *Client) ReadBinaryFile(ctx context.Context, ref compute.Ref, path string) (io.ReadCloser, error)
- func (c *Client) ReadFile(ctx context.Context, req compute.FileReadRequest) (compute.FileReadResult, error)
- func (c *Client) RemoveACLRule(context.Context, string, string, string) error
- func (c *Client) RestartInstance(ctx context.Context, ref compute.Ref, _ bool) (compute.Instance, error)
- func (c *Client) RestoreSnapshot(ctx context.Context, ref compute.Ref, snapshot string) error
- func (c *Client) StartInstance(ctx context.Context, ref compute.Ref, _ bool) (compute.Instance, error)
- func (c *Client) StopInstance(ctx context.Context, ref compute.Ref, _ bool) (compute.Instance, error)
- func (c *Client) WaitInstance(ctx context.Context, req compute.WaitRequest) (compute.WaitResult, error)
- func (c *Client) WriteFile(ctx context.Context, req compute.FileWriteRequest) (compute.FileWriteResult, error)
- type Options
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 (*Client) AddACLRule ¶
func (c *Client) AddACLRule(context.Context, string, string, compute.ACLRule) (compute.ACLRule, error)
AddACLRule is unsupported on the Mac backend.
func (*Client) AttachNIC ¶
func (c *Client) AttachNIC(context.Context, compute.Ref, string, string, string, string) (compute.NIC, error)
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) CreateForward ¶
func (c *Client) CreateForward( context.Context, string, string, compute.Ref, int64, int64, string, ) (compute.Forward, error)
CreateForward is unsupported on the Mac backend.
func (*Client) CreateNetwork ¶
CreateNetwork is unsupported on the Mac backend.
func (*Client) CreateSandbox ¶
CreateSandbox persists a versioned sandbox sidecar under the agentcompute home.
func (*Client) CreateSnapshot ¶
CreateSnapshot clones a stopped guest to a collision-safe VM and restores prior running state.
func (*Client) DeleteFile ¶
DeleteFile removes one literal guest path through SFTP.
func (*Client) DeleteInstance ¶
DeleteInstance force-stops and deletes one guest and its snapshot VMs.
func (*Client) DeleteNetwork ¶
DeleteNetwork is unsupported on the Mac backend.
func (*Client) DeleteSandbox ¶
DeleteSandbox deletes exact mapped VMs then the sidecar. Prefix deletes are never used.
func (*Client) DeleteSnapshot ¶
DeleteSnapshot deletes one snapshot VM by its exact mapped name.
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 ¶
GetInstance returns observed Lume guest state for a mapped instance.
func (*Client) GetNetwork ¶
GetNetwork reports that Mac sandboxes have no managed networks.
func (*Client) GetSandbox ¶
GetSandbox returns one sandbox sidecar.
func (*Client) GetSandboxImage ¶
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 ¶
ListInstances returns guests recorded for a sandbox that still exist on the host.
func (*Client) ListNetworks ¶
ListNetworks returns no agent-facing networks; GetSandbox still succeeds.
func (*Client) ListSandboxes ¶
ListSandboxes returns sandboxes from host sidecars.
func (*Client) ListSnapshots ¶
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 ¶
PeerNetworks is unsupported on the Mac backend.
func (*Client) PinSandbox ¶ added in v0.1.5
func (c *Client) PinSandbox( ctx context.Context, name string, pinned bool, subject string, since time.Time, ) (compute.Sandbox, error)
PinSandbox persists pin metadata in the sidecar without changing expiry.
func (*Client) PublishInstance ¶
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 ¶
func (c *Client) ReadFile(ctx context.Context, req compute.FileReadRequest) (compute.FileReadResult, error)
ReadFile pulls a bounded guest file through SFTP.
func (*Client) RemoveACLRule ¶
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 ¶
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 ¶
func (c *Client) WriteFile(ctx context.Context, req compute.FileWriteRequest) (compute.FileWriteResult, error)
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.