Documentation
¶
Overview ¶
Package lua exposes hex/env to Lua scripts as the "env" module.
local env = require("env")
print(env.current()) -- "development" | "test" | "production"
if env.is_production() then
-- guard destructive writes, etc.
end
if env.is_test() then ... end
if env.is_development() then ... end
The module is stateless once bound; the current environment is captured at install time from *hex.App.Environment(). Apps that hot-swap their environment mid-run (rare) can reinstall.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var TypeStub string
TypeStub is the Teal .d.tl source describing the `env` module.
Functions ¶
This section is empty.
Types ¶
type Bindings ¶
type Bindings struct {
// Environment is the runtime environment reported by env.current().
// Required.
Environment env.Environment
}
Bindings configures the 'env' module. Environment is captured at module install time — usually from *hex.App.Environment() — meaning subsequent reads report the value it had at that moment.
Click to show internal directories.
Click to hide internal directories.