Documentation
¶
Overview ¶
Package protocol defines the JSON request/response envelopes exchanged inside Noise payloads (PRD 24) and the mapping from domain errors to wire codes. Internal error text never crosses the daemon boundary.
Index ¶
Constants ¶
View Source
const ( CodeVaultLocked = "VAULT_LOCKED" CodeAuthFailed = "AUTH_FAILED" CodeNotFound = "NOT_FOUND" CodeDenied = "DENIED" CodeIntegrity = "INTEGRITY_FAILURE" CodeConflict = "CONFLICT" CodeInvalid = "INVALID_REQUEST" CodeRateLimited = "RATE_LIMITED" CodeExists = "ALREADY_EXISTS" CodeUninitialized = "NOT_INITIALIZED" CodeWeakPassword = "WEAK_PASSWORD" CodeInternal = "INTERNAL" )
Error codes (PRD 14.4 maps these to CLI exit codes).
View Source
const Version = 1
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Request ¶
type Request struct {
ProtocolVersion int `json:"protocolVersion"`
RequestID string `json:"requestId"`
Operation string `json:"operation"`
Payload json.RawMessage `json:"payload,omitempty"`
}
type Response ¶
type Response struct {
ProtocolVersion int `json:"protocolVersion"`
RequestID string `json:"requestId"`
OK bool `json:"ok"`
Data json.RawMessage `json:"data,omitempty"`
Error *WireError `json:"error,omitempty"`
}
func ErrResponse ¶
ErrResponse builds a failure envelope from any error.
Click to show internal directories.
Click to hide internal directories.