Documentation
¶
Overview ¶
Package msgcodec runs project-scoped Starlark message codecs that decode (and optionally re-encode) application-layer request/response bodies for display and editing. Codecs never run on the proxy hot path — only on explicit UI/API/MCP decode requests — so failures cannot break forwarding.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Codec ¶
Codec is a compiled Starlark codec.
func Compile ¶
Compile parses a codec script. Requires match(flow, side) and decode(flow, side, raw). encode(flow, side, plaintext) is optional unless apply_on_send is true.
type Flow ¶
type Flow struct {
Method string
Scheme string
Host string
Port int
Path string
Status int
Mime string
ReqHeaders map[string][]string
ResHeaders map[string][]string
ReqBody string
ResBody string
}
Flow is the read-only view handed to match/decode/encode.
type Meta ¶
type Meta struct {
ID string `json:"id"`
Title string `json:"title"`
ApplyOnSend bool `json:"applyOnSend"`
Enabled bool `json:"enabled"`
}
Meta is codec metadata from the script's `meta` dict (or defaults from id).
type Result ¶
type Result struct {
CodecID string `json:"codecId"`
Title string `json:"title,omitempty"`
Plaintext string `json:"plaintext"`
Fields map[string]string `json:"fields,omitempty"`
Note string `json:"note,omitempty"`
Error string `json:"error,omitempty"`
}
Result is what Decode returns for a matching codec.