readyproto

package
v0.7.21 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package readyproto defines the newline-delimited JSON handshake toolboxd sends to sandboxd when a Docker sandbox's agent is ready to serve.

Index

Constants

View Source
const (
	// EventReady is the guest→host readiness announcement after adopt or cold boot.
	EventReady = "ready"
	// EventParked is the guest→host hello from a warm-pool slot awaiting adopt.
	EventParked = "parked"
	// EventAdopt is the host→guest frame that binds real sandbox identity.
	EventAdopt = "adopt"
	// MaxLineBytes caps attacker-controlled read size on the host listener.
	MaxLineBytes = 4 << 10
)

Variables

This section is empty.

Functions

func Encode

func Encode(w io.Writer, sig ReadySignal) error

Encode writes one newline-terminated JSON line.

func EncodeAdopt

func EncodeAdopt(w io.Writer, frame AdoptFrame) error

EncodeAdopt writes a host→guest adopt frame.

func EncodeParked

func EncodeParked(w io.Writer, sig ParkedSignal) error

EncodeParked writes a parked hello line.

Types

type AdoptFrame

type AdoptFrame struct {
	Event     string `json:"event"`
	SandboxID string `json:"sandbox_id"`
	Token     string `json:"token"`
	Nonce     string `json:"nonce"`
}

AdoptFrame is the host→guest identity bind during warm-pool adoption.

func DecodeAdopt

func DecodeAdopt(r io.Reader) (AdoptFrame, error)

DecodeAdopt reads a host→guest adopt frame.

type ParkedSignal

type ParkedSignal struct {
	Event        string `json:"event"`
	Token        string `json:"token"`
	Nonce        string `json:"nonce"`
	AgentVersion string `json:"agent_version,omitempty"`
}

ParkedSignal is the guest→host parked-slot hello.

func DecodeParked

func DecodeParked(r io.Reader) (ParkedSignal, error)

DecodeParked reads a guest→host parked hello.

type ReadySignal

type ReadySignal struct {
	Event        string `json:"event"`
	SandboxID    string `json:"sandbox_id"`
	Token        string `json:"token"`
	Nonce        string `json:"nonce"`
	AgentVersion string `json:"agent_version,omitempty"`
}

ReadySignal is the guest→host readiness announcement.

func Decode

func Decode(r io.Reader) (ReadySignal, error)

Decode reads one bounded newline-delimited ready line from r.

Jump to

Keyboard shortcuts

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