Documentation
¶
Overview ¶
Package protocol defines the wire contract shared by the CLI and server: exit codes, the JSON response envelope, and (later) the SSH command tokenizer.
Index ¶
Constants ¶
const ( ExitOK = 0 ExitFailure = 1 // general failure ExitUsage = 2 // usage error ExitNotFound = 3 ExitDenied = 4 ExitProtocol = 5 // server/protocol error )
Exit codes shared by the CLI and by control commands run over bare ssh.
const Version = 1
Version is the control-plane protocol version. It is embedded in every JSON response envelope; clients check it opportunistically and refuse on major mismatch. Bump the major on breaking envelope or command changes.
Variables ¶
This section is empty.
Functions ¶
func Tokenize ¶
Tokenize splits an SSH exec command string into argv using POSIX shell-word rules: whitespace separates words; single quotes preserve everything literally; double quotes preserve everything except backslash before \, ", or $; a bare backslash escapes the next character. There is no expansion of any kind — no globbing, variables, or substitution. The client's shell has already applied one layer of quoting before the string reaches us.
Types ¶
Source Files
¶
- protocol.go
- tokenize.go