Help us shape the future of Go! Take the 2026 Go Developer Survey

vmsdk

package
v0.1.58 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

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

type ExecResult struct {
	Stdout   string
	Stderr   string
	ExitCode int
}

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

func (s *SSHExec) Exec(ctx context.Context, cmd string, args ...string) (*ExecResult, error)

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.

Jump to

Keyboard shortcuts

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