pub struct UpstreamDefinition {Show 18 fields
pub name: String,
pub transport: String,
pub protocol: String,
pub role: String,
pub resolve: String,
pub resource_ref: String,
pub secret: String,
pub auth_kind: String,
pub auth_name: Option<String>,
pub auth_prefix: Option<String>,
pub map: Vec<UpstreamMapRule>,
pub reconnect: Option<UpstreamReconnect>,
pub overflow: Option<String>,
pub backpressure_credit: Option<i64>,
pub preset: Option<String>,
pub loc: Loc,
pub leading_trivia: Vec<Trivia>,
pub trailing_trivia: Vec<Trivia>,
}Expand description
upstream Name { transport:, protocol:, role:, resolve:, secret:, auth:, map: [...], reconnect: {...}, overflow:, backpressure: credit(n) }
v2.37.0 — the client dual of socket: axon dials OUT to a third-party
vendor (STT/TTS/realtime speech APIs). The axon-facing interface is a
declared session (referenced by protocol:, same field meaning as
socket) of which axon plays role:; the vendor side is realised by the
map: projection rules — a compile-time-total transcoding contract
(v2.37.0, axon-T849). resolve:/secret: name per-tenant config keys,
never URL/credential literals (axon-T850) — the same “config, not code”
property v2.8.0 gave tool, extended to persistent duplex streams.
Fields§
§name: String§transport: StringWire transport axon dials. Closed catalog; v1 sole member websocket.
protocol: StringThe referenced session declaration’s name — the axon-facing protocol.
role: StringWhich of the session’s two roles axon plays; the peer role is the
vendor’s, realised by the map: transcoding, never by axon code.
resolve: StringPer-tenant config key holding the vendor URL (dot-separated,
SecretKeyPolicy-shaped — never a URL literal).
resource_ref: Stringv2.69.0 — the resource this upstream’s channel runs on
(upstream X { resource: Api }). When present, the upstream DERIVES
its dial address from resource.endpoint (a per-tenant config key,
axon-T944) and its max concurrent connection INSTANCES from
resource.capacity — frames are already governed by
backpressure_credit, so capacity bounds CONNECTIONS, never frames
(making it frames would state one fact twice). Mutually exclusive
with resolve: (axon-T951): resource: beside a resolve: would
declare the channel’s address twice — the v2.67.0 islands defect.
Authority attenuation: the resource encapsulates its own address
resolution; the upstream only names WHICH channel it rides.
secret: StringPer-tenant secret binding for the vendor credential (same charset).
auth_kind: StringAuth handshake kind: header | query | signed_url.
auth_name: Option<String>Header/query-param name (header("Authorization") / query("token")).
auth_prefix: Option<String>Optional header value prefix (header("Authorization", "Token ")).
map: Vec<UpstreamMapRule>The wire↔session transcoding contract; totality checked at v2.37.0.
reconnect: Option<UpstreamReconnect>reconnect: { backoff_ms:, max_attempts:, on_exhausted: }.
overflow: Option<String>Outbound-queue policy when the VENDOR is the slow side — a member of
the existing BackpressurePolicy catalog. None ⇒ fail (honest
default: no silently-lossy audio unless the adopter opts in).
backpressure_credit: Option<i64>Axon-facing credit window, identical semantics to socket.
preset: Option<String>v2.37.0 — set when declared via upstream X from Preset@vN {…};
carries the Preset@vN reference the desugar pass expanded.
loc: Loc§leading_trivia: Vec<Trivia>v1.5.2 — leading comment trivia.
trailing_trivia: Vec<Trivia>v1.5.2 — trailing comment trivia.