Documentation
¶
Overview ¶
Package toml provides a Starlark module for decoding and encoding TOML.
Both directions are hardened against untrusted script input. A deeply nested document overflows the goroutine stack — a Go fatal error that recover() cannot catch — so before the recursive codec runs, decode caps the number of bracket openers in the text (a sound upper bound on parser recursion that needs no string lexing and so cannot be bypassed) and encode walks the value's depth. Decode additionally bounds input size and enforces the exact max_depth / node count on the parsed tree (capwalk); both codec calls recover ordinary panics into errors. The depth / node / input-size caps are host-only (no script setter), so a script cannot widen them. TOML's native date/time values are surfaced as strings (RFC 3339 for full timestamps), never as surprise opaque values.
Index ¶
Constants ¶
const ModuleName = "toml"
ModuleName is the name used in Starlark's load() for this module.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module wraps a ConfigurableModule with TOML functions.
func NewModule ¶
func NewModule() *Module
NewModule creates a new Module with default configuration.
func (*Module) LoadModule ¶
func (m *Module) LoadModule() starlet.ModuleLoader
LoadModule returns the Starlark module loader.