Documentation
¶
Overview ¶
Package runnerproto defines the protocol between an app and the runner that hosts it. Framework packages and runners import it; apps do not.
Index ¶
Constants ¶
const ( RunnerSocket = "runner.sock" AppSocket = "app.sock" // MySQLSocket exists only when the app declares sqldb. MySQLSocket = "mysql.sock" )
Socket file names inside the runner directory.
const ( // DefaultCallDeadline applies to a call whose context has no deadline. DefaultCallDeadline = 10 * time.Second // MaxCallDeadline caps the deadline of every call. MaxCallDeadline = 30 * time.Second )
Deadlines of calls between apps.
const ( // MaxOutboundBody bounds the body of a request and of its response, in bytes. MaxOutboundBody = 10 << 20 // MaxOutboundRequests bounds the requests one instance of an app has under way at once. MaxOutboundRequests = 16 // OutboundDeadline bounds a whole request, from the dial to the end of the response body. OutboundDeadline = 30 * time.Second )
Bounds of the requests an app sends to outside services through the runner.
const ( OriginHeader = "Aicoded-Origin" OriginRunner = "runner" )
The runner marks every refusal of a call between apps that it makes itself with the error metadata OriginHeader: OriginRunner. An error the called app returns never carries the mark, so an app reads an error code only from a marked error.
const EnvRunnerDir = "AICODED_RUNNER_DIR"
EnvRunnerDir names the only environment variable an app gets: the directory holding the runner's sockets.
const MaxForwardedTokenAge = 10 * time.Minute
MaxForwardedTokenAge is how long after issuing a viewer token the runner still accepts it back from the app, to call another app as that viewer: the lifetime of a live page connection.
const MaxMessageBytes = 16 << 20
MaxMessageBytes bounds one message on the runner socket: a runner refuses a larger request and an app a larger response.
const MinProtocolVersion uint32 = 3
MinProtocolVersion is the oldest version of the protocol a runner of this framework serves: protocol 3 lacks only outbound.
const ProtocolVersion uint32 = 4
ProtocolVersion is the version of the app–runner protocol this framework speaks.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package egress sends a runner's checked requests to outside services.
|
Package egress sends a runner's checked requests to outside services. |
|
Package mailrules holds the rules every message must follow before a runner sends it: the idempotency key, plain addresses, header fields without line breaks or control characters, the allowed headers, sizes, mailbox folders and the pages of a mailbox list.
|
Package mailrules holds the rules every message must follow before a runner sends it: the idempotency key, plain addresses, header fields without line breaks or control characters, the allowed headers, sizes, mailbox folders and the pages of a mailbox list. |
|
Package mysqlproxy serves an app's mysql.sock.
|
Package mysqlproxy serves an app's mysql.sock. |
|
Package server serves the runner protocol to one app: runner.sock, and mysql.sock through mysqlproxy when the app declares sqldb.
|
Package server serves the runner protocol to one app: runner.sock, and mysql.sock through mysqlproxy when the app declares sqldb. |
|
Package socket connects apps and runners over Unix sockets using HTTP/2 without TLS.
|
Package socket connects apps and runners over Unix sockets using HTTP/2 without TLS. |
|
Package viewer signs and verifies the short-lived viewer tokens a runner attaches to every request it forwards to an app.
|
Package viewer signs and verifies the short-lived viewer tokens a runner attaches to every request it forwards to an app. |