Documentation
¶
Overview ¶
Package api is the sheet API's HTTP surface: one URL per document, the action selected by method × media type. The document plane (store, version, apply, notify) evaluates no expression; the compute plane — enabled when the operator turns it on — serves computed values in the SPECIFICATION §9 vendor types, making every served sheet an IMPORT*-able origin.
Index ¶
Constants ¶
const ( TypeDoc = "application/vnd.tsvsheet.doc+tsv" TypeEdits = "application/vnd.tsvsheet.edits+tsv" TypeCells = "application/vnd.tsvsheet.cells+tsv" TypeSheet = "application/vnd.tsvsheet+tsv" TypeCell = "application/vnd.tsvsheet.cell+tsv" TypeRow = "application/vnd.tsvsheet.row+tsv" TypeColumn = "application/vnd.tsvsheet.column+tsv" TypeRange = "application/vnd.tsvsheet.range+tsv" TypeTSV = "text/tab-separated-values" TypeCSV = "text/csv" TypeStream = "text/event-stream" TypeProblem = "application/problem+json" )
The +tsv media-type family the API speaks. TypeDoc and TypeEdits are the document plane's own; the §9 vendor types (TypeSheet through TypeRange) mean computed values, exactly as the language's IMPORT* builtins request them.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Clock ¶
Clock supplies the compute plane's evaluation time, injected so volatile functions are deterministic under test.
type ComputePlane ¶
type ComputePlane bool
ComputePlane selects whether the server carries the engine's compute plane.
const ( DocumentPlaneOnly ComputePlane = false WithComputePlane ComputePlane = true )
The two plane configurations, named at the call sites.
type Config ¶
type Config struct {
Store *store.Store
Clock Clock
Limits tsvsheet.Limits
ComputeEnabled ComputePlane
}
Config assembles a handler.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is the sheet API's http.Handler.
Pointer receivers are necessary: the handler owns the feed hub and the idempotency replay cache, which carry mutexes and shared maps.
func NewHandler ¶
NewHandler builds the API handler over its store.