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

workspace

package
v0.0.0-...-22a8ce6 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package workspace implements the authenticated host/guest Workspace RPC adapter.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAssignedRootUnavailable means the authenticated guest root could not be opened.
	// It deliberately carries no backend detail because callers project it across trust boundaries.
	ErrAssignedRootUnavailable = errors.New("microvm assigned root is unavailable")
)

Functions

This section is empty.

Types

type Guest

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

Guest serves the confined filesystem side of the authenticated guest protocol.

func NewGuest

func NewGuest(root string, binding control.Binding) (*Guest, error)

NewGuest opens root as the guest's /workspace mount.

func (*Guest) Close

func (g *Guest) Close() error

Close releases the guest's confined workspace root.

func (*Guest) Handler

func (g *Guest) Handler() control.Handler

Handler returns the workspace service for the shared guest multiplexer.

type Workspace

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

Workspace is the host-side mecatl adapter for one authenticated guest mount.

func New

func New(client *control.Client, binding control.Binding) (*Workspace, error)

New constructs a Workspace over an already-authenticated multiplexed guest connection.

func NewAt

func NewAt(client *control.Client, binding control.Binding, root string) (*Workspace, error)

NewAt constructs a Workspace affined to one authenticated logical guest root.

func (*Workspace) CreateFile

func (w *Workspace) CreateFile(ctx context.Context, path string, data []byte) (tool.FileVersion, error)

CreateFile performs an atomic create-only guest mutation.

func (*Workspace) Glob

func (w *Workspace) Glob(ctx context.Context, pattern string) ([]string, error)

Glob returns bounded, deterministic guest-relative matches.

func (*Workspace) Grep

func (w *Workspace) Grep(ctx context.Context, pattern, pathGlob string) ([]tool.GrepMatch, error)

Grep returns bounded guest-relative regular-expression matches.

func (*Workspace) Read

func (w *Workspace) Read(ctx context.Context, path string) ([]byte, error)

Read reads bounded bytes from the guest workspace.

func (*Workspace) ReadVersion

func (w *Workspace) ReadVersion(ctx context.Context, path string) ([]byte, tool.FileVersion, error)

ReadVersion returns guest bytes and their opaque authoritative version.

func (*Workspace) RecordRead

func (w *Workspace) RecordRead(path string, version tool.FileVersion)

RecordRead records the exact supplied version without guest I/O.

func (*Workspace) RecordedVersion

func (w *Workspace) RecordedVersion(path string) (tool.FileVersion, bool)

RecordedVersion performs an I/O-free lookup in the host-side live ledger.

func (*Workspace) ReplaceFile

func (w *Workspace) ReplaceFile(ctx context.Context, path string, old tool.FileVersion, data []byte) (tool.FileVersion, error)

ReplaceFile conditionally replaces a guest file using its opaque version.

func (*Workspace) Root

func (w *Workspace) Root() string

Root returns the authenticated guest execution root shared with the bound runner.

func (*Workspace) Stat

func (w *Workspace) Stat(ctx context.Context, path string) (tool.FileInfo, error)

Stat returns guest file metadata without exposing OS-specific values.

Jump to

Keyboard shortcuts

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