Skip to main content

Module transform

Module transform 

Source
Expand description

The transform pipeline: traits a request/response step implements, the mutable request/response views they operate on, and the registry of code-registered custom transforms.

Modules§

error_remap
error_remap response built-in: when the upstream status equals when_status, replace the body with a normalized {error, detail?} contract (status kept).
inject
inject built-in: set a header or a dotted body path from a context key or a constant. Caller-supplied values at the target are overwritten.
wrap
wrap built-in: nest the incoming JSON body under a key, then inject sibling fields. Reproduces the integration /call envelope: { <under>: <original body>, org: …, workspace: … }.

Structs§

ProxyRequest
Mutable view of the request a RequestTransform may edit before forwarding. body is JSON when present; non-JSON bodies are exposed as raw bytes and are not editable as JSON.
ProxyResponse
Mutable view of the upstream response. v1 transforms touch status/headers and may replace the body with a small JSON value; if no replacement is set the handler streams the upstream body unchanged.
TransformRegistry
Code-registered custom transforms, looked up by { transform = "name" }.

Enums§

TransformError
A step’s failure: Reject short-circuits the pipeline with a contract body.

Traits§

RequestTransform
ResponseTransform