Documentation
¶
Overview ¶
Package static serves bundled / workspace files for the txco://static op, layered first-match-wins: a routed stack's own <workspace>/OPS/<stack>/FILES/** , the chassis-wide <workspace>/FILES/** , then the embedded open-core default (favicon.ico).
The set + the bytes are loaded into memory at startup and rebuilt on dbcache reload (see Index). A request NEVER touches the filesystem: Resolve is a pure in-memory radix lookup, so static serving and the boot pipeline that calls it stay off the disk critical path.
Index ¶
Constants ¶
const ( MaxIndexFiles = 2048 MaxIndexBytes = 64 << 20 MaxIndexDepth = 10 )
Index-build budget across the workspace layers (the embedded default is trusted and always loaded, exempt from these). Bounds the in-memory cache so a runaway FILES/ tree can't exhaust RAM; overflow is logged and skipped (already-indexed files still serve).
const MaxFileBytes = 1 << 20
MaxFileBytes caps any single static file. Same 1 MiB ceiling the continuation worker callback uses (server/personality/web/continuation.go). Larger files are skipped at index-build time (never read per request).
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
Index is the in-memory static set, three layers deep (per routed stack → chassis-wide → embedded). Trees are immutable (github.com/hashicorp/go-immutable-radix); Rebuild builds fresh ones and swaps under mu. Reads snapshot the pointers under mu then use the immutable structures lock-free — the processor.Unit.Mux idiom.
func NewIndex ¶
NewIndex builds the index immediately so the chassis serves correctly before the first reload.