Documentation
¶
Overview ¶
Package plugin answers a family's address in this process.
A family service may run in the process that relays to it: its engine linked as a Go package (the zen and enso engines are their Rust core, translated by wasm2go, behind an http.Handler that runs the module and makes its upstream calls) and registered here under a name. The address plugin://<name> is then that handler, called directly: no socket, no second process. Every other address is the network's. The address is the only thing that differs, so the relay, the tells, billing, failover rows and attribution are the HTTP path's.
Index ¶
Constants ¶
const Scheme = "plugin"
Scheme is the address scheme a plugin answers at: plugin://zen is the handler registered as "zen".
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Transport ¶
type Transport struct {
// Head bounds how long the handler may take to begin its answer; zero is no
// bound but the request's own context.
Head time.Duration
}
Transport answers plugin:// requests in process, as an http.RoundTripper: the request is served by the registered handler, and its answer read back as the HTTP answer it would have been, its body as it is written and its trailers once the body ends. Register it on an http.Transport:
t.RegisterProtocol(plugin.Scheme, plugin.Transport{Head: t.ResponseHeaderTimeout})