Versions in this module Expand all Collapse all v0 v0.0.2 Jul 5, 2026 v0.0.1 Jul 5, 2026 Changes in this version + var ErrClosed = errors.New("luart: runtime closed") + var ErrInstructionLimit = errors.New("luart: instruction limit exceeded") + func HashVersion(src string) string + type Change struct + DisplayVersion string + Key string + Version string + type CompileCache struct + func NewCompileCache() *CompileCache + func (c *CompileCache) CompileCount() int64 + func (c *CompileCache) GetOrCompile(cacheKey, name, src string) (*lua.Proto, error) + type Config struct + ConvertValue func(L *lua.LState, lv lua.Value) (any, error) + ExecTimeout time.Duration + ExtraLibs []func(*lua.LState) + IdleTTL time.Duration + IsolateGlobals bool + JanitorInterval time.Duration + Libs []func(*lua.LState) + Logger Logger + MaxInstructions uint64 + MaxStates int + MemoryBudgetBytes uint64 + Metrics Metrics + Trace TraceHook + func (c Config) Validate() error + type Logger interface + Error func(msg string, keyvals ...any) + Info func(msg string, keyvals ...any) + func NewSlogLogger(l *slog.Logger) Logger + type MapLoader struct + func NewMapLoader() *MapLoader + func (l *MapLoader) Load(key string) (string, string, string, error) + func (l *MapLoader) Loads() int64 + func (l *MapLoader) Set(key, src, version, displayVersion string) + type Metrics interface + OnBuild func(key string) + OnCompile func(key string) + OnDrop func(key string) + OnEvict func(key string) + OnReuse func(key string) + type PoolStat struct + CheckedOut int + DisplayVersion string + Idle int + Key string + VersionShort string + type Runtime struct + func New(loader SourceLoader, cfg Config) *Runtime + func (m *Runtime) Close() + func (m *Runtime) CompileCount() int64 + func (m *Runtime) Notify(key, version, displayVersion string) + func (m *Runtime) NotifyChanges(changes []Change) + func (m *Runtime) PoolStats() []PoolStat + func (m *Runtime) Run(ctx context.Context, key, entryFn string, args ...lua.Value) ([]lua.Value, error) + func (m *Runtime) RunValues(ctx context.Context, key, entryFn string, args ...lua.Value) ([]any, error) + func (m *Runtime) RunWith(ctx context.Context, key, entryFn string, ...) error + func (m *Runtime) Shutdown(ctx context.Context) error + func (m *Runtime) Stats() Stats + type SourceLoader interface + Load func(key string) (src, version, displayVersion string, err error) + type Stats struct + LiveStates int + MaxStates int + Pools int + type TraceHook func(stage, key string, dur time.Duration)