Documentation
¶
Overview ¶
Package wire defines the JSON envelope protocol exchanged with the CLIProxyAPI host. Every plugin method returns an {ok, result, error} envelope; this package centralizes its encoding so the CGO bridge and all domain handlers agree on the wire format.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorStatus ¶
ErrorStatus returns an error envelope carrying an HTTP status the host can use to drive retry/refresh scheduling.
Types ¶
type Envelope ¶
type Envelope struct {
OK bool `json:"ok"`
Result json.RawMessage `json:"result,omitempty"`
Error *EnvelopeError `json:"error,omitempty"`
}
Envelope is the JSON wire format exchanged with the host: {ok, result, error}.
type EnvelopeError ¶
type EnvelopeError struct {
Code string `json:"code"`
Message string `json:"message"`
HTTPStatus int `json:"http_status,omitempty"`
}
EnvelopeError carries a plugin error plus an optional HTTP status the host can use to drive retry/refresh scheduling.
Click to show internal directories.
Click to hide internal directories.