Skip to main content

Module path

Module path 

Source
Expand description

Turning one contract-described call into a URL against a base.

§Two bases, two meanings

A standalone client points at a tapes server’s root: http://host:8081, and /v1/sessions is the whole path. A platform client points at a gateway that mounts tapes under a prefix — https://<slug>.<host>/<gateway>/tapes/ — and /v1/sessions has to land under that prefix or the request leaves for the cloud edge root, most likely a 404 and conceivably a wrong-gateway route, neither of which looks like a URL bug at the call site.

Those are not the same operation, and a builder that silently picks one is wrong for the other client. PathMode makes the caller say which, and both are pinned by their own test below.

The percent-encoding rules are shared by both modes and are the reason this belongs in one place: a path value is substituted into its segment and the segment is pushed whole through path_segments_mut, so a value containing ../ stays one segment instead of addressing a different route.

Both surfaces join here. A cassette route and a sealed-contract route are the same kind of string against the same kind of base, and when the two had a builder each only one of them had learned about gateway prefixes.

Enums§

PathMode
How a contract path template is joined onto a base URL.

Functions§

call_url
Build the URL for one described call against a base, in the given mode.