Documentation
¶
Overview ¶
Package wire is the emulated shell's relay protocol: length-delimited protobuf Frames over a Unix socket, one invocation per connection (wire.proto, docs/explainers/2026-11-01-emulated-shell-sandbox.md).
Index ¶
- Constants
- Variables
- type Cancel
- type Frame
- func (*Frame) Descriptor() ([]byte, []int)deprecated
- func (x *Frame) GetBody() isFrame_Body
- func (x *Frame) GetCancel() *Cancel
- func (x *Frame) GetInvokeExit() *InvokeExit
- func (x *Frame) GetInvokeStart() *InvokeStart
- func (x *Frame) GetStderrChunk() []byte
- func (x *Frame) GetStdinChunk() []byte
- func (x *Frame) GetStdinEof() *StdinEOF
- func (x *Frame) GetStdoutChunk() []byte
- func (x *Frame) GetVersion() uint32
- func (*Frame) ProtoMessage()
- func (x *Frame) ProtoReflect() protoreflect.Message
- func (x *Frame) Reset()
- func (x *Frame) String() string
- type Frame_Cancel
- type Frame_InvokeExit
- type Frame_InvokeStart
- type Frame_StderrChunk
- type Frame_StdinChunk
- type Frame_StdinEof
- type Frame_StdoutChunk
- type InvokeExit
- type InvokeStart
- func (*InvokeStart) Descriptor() ([]byte, []int)deprecated
- func (x *InvokeStart) GetArgs() [][]byte
- func (x *InvokeStart) GetCwd() []byte
- func (x *InvokeStart) GetExecId() []byte
- func (x *InvokeStart) GetGuestEnv() [][]byte
- func (x *InvokeStart) GetName() []byte
- func (*InvokeStart) ProtoMessage()
- func (x *InvokeStart) ProtoReflect() protoreflect.Message
- func (x *InvokeStart) Reset()
- func (x *InvokeStart) String() string
- type Reader
- type StdinEOF
- type Writer
Constants ¶
const ChunkSize = 64 << 10
ChunkSize is the largest stdin, stdout or stderr chunk a peer sends.
const MaxFrame = 1 << 20
MaxFrame is the largest encoded frame, 1 MiB (spec §10.1); larger lengths fail before allocation.
const Version = 1
Version is the only protocol version the broker accepts.
Variables ¶
var File_wire_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Cancel ¶
type Cancel struct {
Reason []byte `protobuf:"bytes,1,opt,name=reason,proto3" json:"reason,omitempty"`
// contains filtered or unexported fields
}
func (*Cancel) Descriptor
deprecated
func (*Cancel) ProtoMessage ¶
func (*Cancel) ProtoMessage()
func (*Cancel) ProtoReflect ¶
func (x *Cancel) ProtoReflect() protoreflect.Message
type Frame ¶
type Frame struct {
Version uint32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"`
// Types that are valid to be assigned to Body:
//
// *Frame_InvokeStart
// *Frame_StdinChunk
// *Frame_StdinEof
// *Frame_StdoutChunk
// *Frame_StderrChunk
// *Frame_InvokeExit
// *Frame_Cancel
Body isFrame_Body `protobuf_oneof:"body"`
// contains filtered or unexported fields
}
func (*Frame) Descriptor
deprecated
func (*Frame) GetInvokeExit ¶
func (x *Frame) GetInvokeExit() *InvokeExit
func (*Frame) GetInvokeStart ¶
func (x *Frame) GetInvokeStart() *InvokeStart
func (*Frame) GetStderrChunk ¶
func (*Frame) GetStdinChunk ¶
func (*Frame) GetStdinEof ¶
func (*Frame) GetStdoutChunk ¶
func (*Frame) GetVersion ¶
func (*Frame) ProtoMessage ¶
func (*Frame) ProtoMessage()
func (*Frame) ProtoReflect ¶
func (x *Frame) ProtoReflect() protoreflect.Message
type Frame_Cancel ¶
type Frame_Cancel struct {
Cancel *Cancel `protobuf:"bytes,8,opt,name=cancel,proto3,oneof"` // either way
}
type Frame_InvokeExit ¶
type Frame_InvokeExit struct {
InvokeExit *InvokeExit `protobuf:"bytes,7,opt,name=invoke_exit,json=invokeExit,proto3,oneof"` // host→guest, last frame
}
type Frame_InvokeStart ¶
type Frame_InvokeStart struct {
InvokeStart *InvokeStart `protobuf:"bytes,2,opt,name=invoke_start,json=invokeStart,proto3,oneof"` // guest→host, first frame only
}
type Frame_StderrChunk ¶
type Frame_StderrChunk struct {
StderrChunk []byte `protobuf:"bytes,6,opt,name=stderr_chunk,json=stderrChunk,proto3,oneof"` // host→guest
}
type Frame_StdinChunk ¶
type Frame_StdinChunk struct {
StdinChunk []byte `protobuf:"bytes,3,opt,name=stdin_chunk,json=stdinChunk,proto3,oneof"` // guest→host
}
type Frame_StdinEof ¶
type Frame_StdinEof struct {
StdinEof *StdinEOF `protobuf:"bytes,4,opt,name=stdin_eof,json=stdinEof,proto3,oneof"` // guest→host
}
type Frame_StdoutChunk ¶
type Frame_StdoutChunk struct {
StdoutChunk []byte `protobuf:"bytes,5,opt,name=stdout_chunk,json=stdoutChunk,proto3,oneof"` // host→guest
}
type InvokeExit ¶
type InvokeExit struct {
Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` // 0-255
Message []byte `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // sanitized text for the guest's stderr
// contains filtered or unexported fields
}
func (*InvokeExit) Descriptor
deprecated
func (*InvokeExit) Descriptor() ([]byte, []int)
Deprecated: Use InvokeExit.ProtoReflect.Descriptor instead.
func (*InvokeExit) GetCode ¶
func (x *InvokeExit) GetCode() uint32
func (*InvokeExit) GetMessage ¶
func (x *InvokeExit) GetMessage() []byte
func (*InvokeExit) ProtoMessage ¶
func (*InvokeExit) ProtoMessage()
func (*InvokeExit) ProtoReflect ¶
func (x *InvokeExit) ProtoReflect() protoreflect.Message
func (*InvokeExit) Reset ¶
func (x *InvokeExit) Reset()
func (*InvokeExit) String ¶
func (x *InvokeExit) String() string
type InvokeStart ¶
type InvokeStart struct {
ExecId []byte `protobuf:"bytes,1,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"` // claimed execution; the broker compares it with the socket's own
Name []byte `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // registered command name
Cwd []byte `protobuf:"bytes,3,opt,name=cwd,proto3" json:"cwd,omitempty"` // guest path
Args [][]byte `protobuf:"bytes,4,rep,name=args,proto3" json:"args,omitempty"` // argv without the command name
GuestEnv [][]byte `protobuf:"bytes,5,rep,name=guest_env,json=guestEnv,proto3" json:"guest_env,omitempty"` // KEY=VALUE, untrusted metadata
// contains filtered or unexported fields
}
InvokeStart is entirely guest-controlled. There is deliberately no host environment field.
func (*InvokeStart) Descriptor
deprecated
func (*InvokeStart) Descriptor() ([]byte, []int)
Deprecated: Use InvokeStart.ProtoReflect.Descriptor instead.
func (*InvokeStart) GetArgs ¶
func (x *InvokeStart) GetArgs() [][]byte
func (*InvokeStart) GetCwd ¶
func (x *InvokeStart) GetCwd() []byte
func (*InvokeStart) GetExecId ¶
func (x *InvokeStart) GetExecId() []byte
func (*InvokeStart) GetGuestEnv ¶
func (x *InvokeStart) GetGuestEnv() [][]byte
func (*InvokeStart) GetName ¶
func (x *InvokeStart) GetName() []byte
func (*InvokeStart) ProtoMessage ¶
func (*InvokeStart) ProtoMessage()
func (*InvokeStart) ProtoReflect ¶
func (x *InvokeStart) ProtoReflect() protoreflect.Message
func (*InvokeStart) Reset ¶
func (x *InvokeStart) Reset()
func (*InvokeStart) String ¶
func (x *InvokeStart) String() string
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader reads frames from one connection.
type StdinEOF ¶
type StdinEOF struct {
// contains filtered or unexported fields
}
func (*StdinEOF) Descriptor
deprecated
func (*StdinEOF) ProtoMessage ¶
func (*StdinEOF) ProtoMessage()
func (*StdinEOF) ProtoReflect ¶
func (x *StdinEOF) ProtoReflect() protoreflect.Message