Documentation
¶
Overview ¶
Package protocol defines the wire format for the agent diag channel: nd-json frames over one long-lived HTTP/3 stream, demuxed by Id so multiple commands can interleave.
Index ¶
Constants ¶
const ( ErrUnknownCommand = "unknown_command" ErrInvalidArgs = "invalid_args" ErrBusy = "busy" ErrDeadlineExceeded = "deadline_exceeded" ErrInternal = "internal" )
Well-known error codes returned by the dispatcher. Commands may return their own codes too; these are reserved for transport-level failures.
const MimeType = "application/x-ndjson"
MimeType is the media type advertised on both halves of the diag stream.
const Path = "/diag/rpc"
Path is the HTTP/3 request path the agent dials on the existing QUIC connection to its tunnelproxy.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Error ¶
Error carries a structured failure for a Request. Code is a stable short token (e.g. "unknown_command", "invalid_args", "busy", "deadline_exceeded"); Message is a human-readable detail.
type Request ¶
type Request struct {
Id uint64 `json:"id"`
Command string `json:"command"`
Args json.RawMessage `json:"args,omitempty"`
}
Request is a single command invocation sent down to the agent.
type Response ¶
type Response struct {
Id uint64 `json:"id"`
Result json.RawMessage `json:"result,omitempty"`
Error *Error `json:"error,omitempty"`
Chunk json.RawMessage `json:"chunk,omitempty"`
Done bool `json:"done,omitempty"`
}
Response is one frame in the up direction. Exactly one of Result, Error, Chunk, or Done is set per frame.