lua

package
v0.0.1-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2026 License: MIT Imports: 3 Imported by: 0

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.

func (*Bindings) Loader

func (b *Bindings) Loader(L *glua.LState) int

Loader is the gopher-lua LGFunction registered against env.PreloadModule("env", b.Loader).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL