Documentation
¶
Overview ¶
Package lua exposes hex/config to Lua scripts as the "config" module.
local config = require("config")
local port = config.string("server.address")
local n = config.int("db.pool.max_open")
local dbg = config.bool("app.debug")
local t = config.duration("http.timeout") -- returns seconds (number)
local xs = config.stringSlice("app.mirrors")
config.set("app.name", "reset from REPL") -- runtime override
local exists = config.has("some.key")
for _, ns in ipairs(config.namespaces()) do
print(ns)
end
The `duration` helper returns the value as seconds (Lua number). Convert to milliseconds by multiplying by 1000 if needed.
Errors return (nil, "message"). config.set surfaces validation failures against the CUE schema when applicable.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var TypeStub string
TypeStub is the Teal .d.tl source describing the `config` module.
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.