Documentation
¶
Overview ¶
Package inproc answers a GET against the platform's own routes inside the process, as an anonymous caller on loopback.
A document drawn in the headless renderer loads its references and the served slide runtime from the platform's own origin, and the renderer has no route to the platform: every request it makes is answered by the platform. The tile worker and the PDF export both answer those requests here, so the page gets what a reader's browser would get from the same route and nothing a session would add.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
func Get(routes http.Handler, path string, timeout time.Duration) (body []byte, contentType string, ok bool)
Get calls routes for one GET of path and returns the body and its content type when the route answers 200. It carries no credentials, so only a route that answers anonymously can answer it.
It is marked as the platform's own request, which the public viewer's rate limiter admits without counting (#1791). Counted, every request presents the one loopback address and shares one bucket, and the reference route in front of a document's files ran it dry partway through a document.
Types ¶
type Recorder ¶
type Recorder struct {
// Body is what the route wrote.
Body bytes.Buffer
// contains filtered or unexported fields
}
Recorder is a response a route writes into in-process.
func (*Recorder) WriteHeader ¶
WriteHeader records the first status the route writes.