Documentation
¶
Overview ¶
Package vmsdk provides hypervisor-agnostic VM guest communication interfaces and implementations. Any VM provider can use these to run commands inside guest operating systems.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExecResult ¶
ExecResult holds the output of a guest command execution.
type GuestExec ¶
type GuestExec interface {
Exec(ctx context.Context, cmd string, args ...string) (*ExecResult, error)
}
GuestExec executes commands on a VM guest OS.
type GuestExecStreamer ¶ added in v0.1.34
type GuestExecStreamer interface {
ExecStream(ctx context.Context, cmd string, args []string, sink eventstream.Sink) (*ExecResult, error)
}
GuestExecStreamer is an optional capability for guests that can expose command output before the process exits. Implementations must preserve stdout/stderr channel identity and return only after a terminal result is available; the caller owns completion-event publication.
type SSHExec ¶
type SSHExec struct {
Host string
Port string // default "22"
User string
PrivateKey []byte // PEM-encoded private key; used when non-empty
Password string // used when no PrivateKey is provided
}
SSHExec implements GuestExec over SSH. A new connection is made per Exec call (no pooling needed for Boxy's short-lived VM use case).
func (*SSHExec) Exec ¶
Exec opens an SSH session, runs the command, and returns stdout/stderr/exit code.
func (*SSHExec) ExecStream ¶ added in v0.1.34
func (s *SSHExec) ExecStream(ctx context.Context, cmd string, args []string, sink eventstream.Sink) (*ExecResult, error)
ExecStream opens an SSH session and forwards stdout/stderr as data arrives.