Versions in this module Expand all Collapse all v1 v1.5.12 Mar 3, 2026 v1.5.11 Feb 21, 2026 v1.5.10 Feb 20, 2026 v1.5.9 Feb 14, 2026 v1.5.8 Feb 14, 2026 v1.5.7 Feb 12, 2026 v1.5.6 Feb 11, 2026 v1.5.5 Feb 10, 2026 v1.5.4 Feb 7, 2026 Changes in this version + func ConfigureErrorMetadataExtractor(extractor ErrorMetadataExtractor) + func SetErrorMetadataExtractor(extractor ErrorMetadataExtractor) type Error + func WrapErrorWithMetadata(err error, context string, extractor ErrorMetadataExtractor) *Error + type ErrorMetadata struct + Details map[string]any + Kind Kind + Retryable *bool + type ErrorMetadataExtractor func(err error) *ErrorMetadata v1.5.3 Feb 5, 2026 v1.5.2 Feb 3, 2026 Changes in this version + const OP_LOADTYPE + type CompileOptions struct + TypeInfo []byte + TypeNames map[string]struct{} type FunctionProto + func CompileWithOptions(chunk []ast.Stmt, name string, opts CompileOptions) (proto *FunctionProto, err error) v1.5.1 Feb 2, 2026 v1.5.0 Feb 2, 2026 Changes in this version + const BaseLibName + const CoroutineLibName + const DebugLibName + const EnvironIndex + const ErrorsLibName + const FramesPerSegment + const GlobalsIndex + const LNumberBit + const LoadLibName + const MathLibName + const MultRet + const OP_ADD + const OP_BAND + const OP_BNOT + const OP_BOR + const OP_BXOR + const OP_CALL + const OP_CLOSE + const OP_CLOSURE + const OP_CONCAT + const OP_DIV + const OP_EQ + const OP_FORLOOP + const OP_FORPREP + const OP_GETGLOBAL + const OP_GETTABLE + const OP_GETTABLEKS + const OP_GETUPVAL + const OP_IDIV + const OP_JMP + const OP_LE + const OP_LEN + const OP_LOADBOOL + const OP_LOADK + const OP_LOADNIL + const OP_LT + const OP_MOD + const OP_MOVE + const OP_MOVEN + const OP_MUL + const OP_NEWTABLE + const OP_NOP + const OP_NOT + const OP_POW + const OP_RETURN + const OP_SELF + const OP_SETGLOBAL + const OP_SETLIST + const OP_SETTABLE + const OP_SETTABLEKS + const OP_SETUPVAL + const OP_SHL + const OP_SHR + const OP_SUB + const OP_TAILCALL + const OP_TEST + const OP_TESTSET + const OP_TFORLOOP + const OP_UNM + const OP_VARARG + const PackageName + const PackageVersion + const RegistryIndex + const StringLibName + const TabLibName + const Utf8LibName + const VarArgIsVarArg + const Version + var CallStackSize = 128 + var DirSep string + var ExecDir = "!" + var FieldsPerFlush = 50 + var IgMark = "-" + var LDir string + var LFalse = LBool(false) + var LNil = LValue(&LNilType{}) + var LTrue = LBool(true) + var LTypeAny = <ype + var LTypeBoolean = <ype + var LTypeInteger = <ype + var LTypeNever = <ype + var LTypeNil = <ype + var LTypeNumber = <ype + var LTypeString = <ype + var LTypeUnknown = <ype + var MaxArrayIndex = 67108864 + var MaxTableGetLoop = 100 + var PathDefault string + var PathEnvVar = "LUA_PATH" + var PathMark = "?" + var PathSep = ";" + var RegistryGrowStep = 32 + var RegistryMaxSize = 256 * 256 + var RegistrySize = 256 + func IsErrorKind(err error, kind Kind) bool + func IsIntegerValue(v LNumber) bool + func LVAsBool(v LValue) bool + func LVAsString(v LValue) string + func LVCanConvToString(v LValue) bool + func LVIsFalse(v LValue) bool + func OpenBase(L *LState) int + func OpenCoroutine(L *LState) int + func OpenDebug(L *LState) int + func OpenErrors(L *LState) int + func OpenMath(L *LState) int + func OpenPackage(L *LState) int + func OpenString(L *LState) int + func OpenTable(L *LState) int + func OpenUtf8(L *LState) int + func RegisterErrorMetatable(L *LState) + func ReleaseSpawnRequest(sr *SpawnRequest) + func SetErrorMetatable(L *LState, e *Error) + func TypeEquals(a, b *LType) bool + func TypeIsSubtype(a, b *LType) bool + func UpvalueIndex(i int) int + type ApiError struct + Cause error + Object LValue + StackTrace string + Type ApiErrorType + func (e *ApiError) Error() string + func (e *ApiError) String() string + type ApiErrorType int + const ApiErrorError + const ApiErrorFile + const ApiErrorPanic + const ApiErrorRun + const ApiErrorSyntax + type CompileError struct + Line int + Message string + func (e *CompileError) Error() string + func (e *CompileError) String() string + type DbgCall struct + Name string + Pc int + type DbgLocalInfo struct + EndPc int + Name string + StartPc int + type Debug struct + CurrentLine int + LastLineDefined int + LineDefined int + NUpvalues int + Name string + Source string + What string + type Error struct + Context string + Err error + LuaStack *StackTrace + Message string + func AsError(v LValue) (*Error, bool) + func GetError(err error) *Error + func NewError(message string) *Error + func NewErrorf(format string, args ...any) *Error + func NewLuaError(L *LState, message string) *Error + func WrapError(err error, context string) *Error + func WrapErrorWithLua(l *LState, err error, context string) *Error + func (e *Error) Details() map[string]any + func (e *Error) Error() string + func (e *Error) Kind() Kind + func (e *Error) Retryable() Ternary + func (e *Error) Stack() string + func (e *Error) String() string + func (e *Error) Type() LValueType + func (e *Error) Unwrap() error + func (e *Error) WithContext(ctx string) *Error + func (e *Error) WithDetails(d map[string]any) *Error + func (e *Error) WithKind(k Kind) *Error + func (e *Error) WithRetryable(r bool) *Error + type FunctionProto struct + Code []uint32 + Constants []LValue + DbgCalls []DbgCall + DbgLocals []*DbgLocalInfo + DbgSourcePositions []int + DbgUpvalues []string + FunctionPrototypes []*FunctionProto + IsVarArg uint8 + LastLineDefined int + LineDefined int + NumParameters uint8 + NumUpvalues uint8 + NumUsedRegisters uint8 + SourceName string + TypeInfo []byte + func Compile(chunk []ast.Stmt, name string) (proto *FunctionProto, err error) + func CompileReader(reader io.Reader, name string) (*FunctionProto, error) + func CompileString(source, name string) (*FunctionProto, error) + func (fp *FunctionProto) GetTypeInfo() []byte + func (fp *FunctionProto) RebuildStringConstants() + func (fp *FunctionProto) SetTypeInfo(data []byte) + func (fp *FunctionProto) String() string + type Global struct + CurrentThread *LState + Global *LTable + MainThread *LState + Owner any + Registry *LTable + type Kind string + const AlreadyExists + const Canceled + const Conflict + const Internal + const Invalid + const NotFound + const PermissionDenied + const RateLimited + const Timeout + const Unavailable + const Unknown + func GetErrorKind(err error) Kind + func (k Kind) String() string + type LBool bool + func (bl LBool) Bool() bool + func (bl LBool) String() string + func (bl LBool) Type() LValueType + type LFunction struct + Env *LTable + GFunction LGFunction + IsG bool + Proto *FunctionProto + Upvalues []*Upvalue + func (fn *LFunction) LocalName(regno, pc int) (string, bool) + func (fn *LFunction) String() string + func (fn *LFunction) Type() LValueType + type LGContinuation func(L *LState, ctx any, status ResumeState) int + type LGFunction func(*LState) int + type LGoFunc LGFunction + func (gf LGoFunc) String() string + func (gf LGoFunc) Type() LValueType + type LInteger int64 + func (i LInteger) Int64() int64 + func (i LInteger) String() string + func (i LInteger) Type() LValueType + type LNilType struct + func (nl *LNilType) String() string + func (nl *LNilType) Type() LValueType + type LNumber float64 + func LVAsNumber(v LValue) LNumber + func (nm LNumber) Float64() float64 + func (nm LNumber) Format(f fmt.State, c rune) + func (nm LNumber) String() string + func (nm LNumber) Type() LValueType + type LState struct + Dead bool + Env *LTable + G *Global + Options Options + Panic func(*LState) + Parent *LState + func NewState(opts ...Options) *LState + func (ls *LState) ArgError(n int, message string) + func (ls *LState) Call(nargs, nret int) + func (ls *LState) CallByParam(cp P, args ...LValue) error + func (ls *LState) CallK(nargs, nret int, cont LGContinuation, ctx any) + func (ls *LState) CallMeta(obj LValue, event string) LValue + func (ls *LState) CheckAny(n int) LValue + func (ls *LState) CheckBool(n int) bool + func (ls *LState) CheckFunction(n int) *LFunction + func (ls *LState) CheckInt(n int) int + func (ls *LState) CheckInt64(n int) int64 + func (ls *LState) CheckNumber(n int) LNumber + func (ls *LState) CheckOption(n int, options []string) int + func (ls *LState) CheckString(n int) string + func (ls *LState) CheckTable(n int) *LTable + func (ls *LState) CheckThread(n int) *LState + func (ls *LState) CheckType(n int, typ LValueType) + func (ls *LState) CheckTypes(n int, typs ...LValueType) + func (ls *LState) CheckUserData(n int) *LUserData + func (ls *LState) Close() + func (ls *LState) Concat(values ...LValue) string + func (ls *LState) Context() context.Context + func (ls *LState) CreateTable(acap, hcap int) *LTable + func (ls *LState) DoFile(path string) error + func (ls *LState) DoString(source string) error + func (ls *LState) Equal(lhs, rhs LValue) bool + func (ls *LState) Error(lv LValue, level int) + func (ls *LState) FindTable(obj *LTable, n string, size int) LValue + func (ls *LState) ForEach(tb *LTable, cb func(LValue, LValue)) + func (ls *LState) GPCall(fn LGFunction, data LValue) error + func (ls *LState) Get(idx int) LValue + func (ls *LState) GetField(obj LValue, skey string) LValue + func (ls *LState) GetGlobal(name string) LValue + func (ls *LState) GetInfo(what string, dbg *Debug, fn LValue) (LValue, error) + func (ls *LState) GetLocal(dbg *Debug, no int) (string, LValue) + func (ls *LState) GetMetaField(obj LValue, event string) LValue + func (ls *LState) GetMetatable(obj LValue) LValue + func (ls *LState) GetStack(level int) (*Debug, bool) + func (ls *LState) GetTable(obj LValue, key LValue) LValue + func (ls *LState) GetTop() int + func (ls *LState) GetTypeMetatable(typ string) LValue + func (ls *LState) GetUpvalue(fn *LFunction, no int) (string, LValue) + func (ls *LState) Insert(value LValue, index int) + func (ls *LState) IsClosed() bool + func (ls *LState) LessThan(lhs, rhs LValue) bool + func (ls *LState) Load(reader io.Reader, name string) (*LFunction, error) + func (ls *LState) LoadFile(path string) (*LFunction, error) + func (ls *LState) LoadProto(proto *FunctionProto) *LFunction + func (ls *LState) LoadString(source string) (*LFunction, error) + func (ls *LState) NewClosure(fn LGFunction, upvalues ...LValue) *LFunction + func (ls *LState) NewFunction(fn LGFunction) *LFunction + func (ls *LState) NewFunctionFromProto(proto *FunctionProto) *LFunction + func (ls *LState) NewTable() *LTable + func (ls *LState) NewThread() (*LState, context.CancelFunc) + func (ls *LState) NewThreadWithContext(ctx context.Context) *LState + func (ls *LState) NewTypeMetatable(typ string) *LTable + func (ls *LState) NewUserData() *LUserData + func (ls *LState) Next(tb *LTable, key LValue) (LValue, LValue) + func (ls *LState) ObjLen(v1 LValue) int + func (ls *LState) OpenLibs() + func (ls *LState) OptBool(n int, d bool) bool + func (ls *LState) OptFunction(n int, d *LFunction) *LFunction + func (ls *LState) OptInt(n int, d int) int + func (ls *LState) OptInt64(n int, d int64) int64 + func (ls *LState) OptNumber(n int, d LNumber) LNumber + func (ls *LState) OptString(n int, d string) string + func (ls *LState) OptTable(n int, d *LTable) *LTable + func (ls *LState) OptUserData(n int, d *LUserData) *LUserData + func (ls *LState) PCall(nargs, nret int, errfunc *LFunction) (err error) + func (ls *LState) Pop(n int) + func (ls *LState) PreloadModule(name string, loader LGFunction) + func (ls *LState) Push(value LValue) + func (ls *LState) RaiseError(format string, args ...any) + func (ls *LState) RawEqual(lhs, rhs LValue) bool + func (ls *LState) RawGet(tb *LTable, key LValue) LValue + func (ls *LState) RawGetInt(tb *LTable, key int) LValue + func (ls *LState) RawSet(tb *LTable, key LValue, value LValue) + func (ls *LState) RawSetInt(tb *LTable, key int, value LValue) + func (ls *LState) Register(name string, fn LGFunction) + func (ls *LState) RegisterGoModule(name string, funcs map[string]LGoFunc) LValue + func (ls *LState) RegisterModule(name string, funcs map[string]LGFunction) LValue + func (ls *LState) Remove(index int) + func (ls *LState) RemoveContext() context.Context + func (ls *LState) Replace(idx int, value LValue) + func (ls *LState) Resume(th *LState, fn *LFunction, args ...LValue) (ResumeState, error, []LValue) + func (ls *LState) ResumeInto(th *LState, fn *LFunction, retBuf []LValue, args ...LValue) (ResumeState, error, []LValue) + func (ls *LState) SetContext(ctx context.Context) + func (ls *LState) SetField(obj LValue, key string, value LValue) + func (ls *LState) SetFuncs(tb *LTable, funcs map[string]LGFunction, upvalues ...LValue) *LTable + func (ls *LState) SetGlobal(name string, value LValue) + func (ls *LState) SetGoFuncs(tb *LTable, funcs map[string]LGoFunc) *LTable + func (ls *LState) SetLocal(dbg *Debug, no int, lv LValue) string + func (ls *LState) SetMetatable(obj LValue, mt LValue) + func (ls *LState) SetTable(obj LValue, key LValue, value LValue) + func (ls *LState) SetTop(idx int) + func (ls *LState) SetUpvalue(fn *LFunction, no int, lv LValue) string + func (ls *LState) Status(th *LState) string + func (ls *LState) String() string + func (ls *LState) ToBool(n int) bool + func (ls *LState) ToFunction(n int) *LFunction + func (ls *LState) ToInt(n int) int + func (ls *LState) ToInt64(n int) int64 + func (ls *LState) ToNumber(n int) LNumber + func (ls *LState) ToString(n int) string + func (ls *LState) ToStringMeta(lv LValue) LValue + func (ls *LState) ToTable(n int) *LTable + func (ls *LState) ToThread(n int) *LState + func (ls *LState) ToUserData(n int) *LUserData + func (ls *LState) Type() LValueType + func (ls *LState) TypeError(n int, typ LValueType) + func (ls *LState) Where(level int) string + func (ls *LState) XMoveTo(other *LState, n int) + func (ls *LState) Yield(values ...LValue) int + type LString string + func (st LString) Format(f fmt.State, c rune) + func (st LString) String() string + func (st LString) Type() LValueType + type LTable struct + Array []LValue + Dict map[LValue]LValue + Immutable bool + K2i map[LValue]int + Keys []LValue + Metatable LValue + Strdict map[string]LValue + func CreateTable(acap, hcap int) *LTable + func (tb *LTable) Append(value LValue) bool + func (tb *LTable) ForEach(cb func(LValue, LValue)) + func (tb *LTable) Insert(i int, value LValue) bool + func (tb *LTable) Len() int + func (tb *LTable) MaxN() int + func (tb *LTable) Next(key LValue) (LValue, LValue) + func (tb *LTable) RawGet(key LValue) LValue + func (tb *LTable) RawGetH(key LValue) LValue + func (tb *LTable) RawGetInt(key int) LValue + func (tb *LTable) RawGetString(key string) LValue + func (tb *LTable) RawSet(key LValue, value LValue) bool + func (tb *LTable) RawSetH(key LValue, value LValue) bool + func (tb *LTable) RawSetInt(key int, value LValue) bool + func (tb *LTable) RawSetString(key string, value LValue) bool + func (tb *LTable) Remove(pos int) (LValue, bool) + func (tb *LTable) String() string + func (tb *LTable) Type() LValueType + type LType struct + func NewLType(t typ.Type) *LType + func NewNamedLType(t typ.Type, name string) *LType + func (lt *LType) GoString() string + func (lt *LType) Inner() typ.Type + func (lt *LType) KindString() string + func (lt *LType) Name() string + func (lt *LType) String() string + func (lt *LType) Type() LValueType + func (lt *LType) Validate(L *LState, val LValue) bool + type LUserData struct + Metatable LValue + Value interface{} + func (ud *LUserData) String() string + func (ud *LUserData) Type() LValueType + type LValue interface + String func() string + Type func() LValueType + type LValueType int + const LTBool + const LTChannel + const LTFunction + const LTInteger + const LTNil + const LTNumber + const LTString + const LTTable + const LTThread + const LTType + const LTUserData + func (vt LValueType) String() string + type Options struct + CallStackSize int + IncludeGoStackTrace bool + MinimizeStackMemory bool + RegistryGrowStep int + RegistryMaxSize int + RegistrySize int + SkipOpenLibs bool + type P struct + Fn LValue + Handler *LFunction + NRet int + Protect bool + type ResumeState int + const ResumeError + const ResumeOK + const ResumeYield + type SpawnRequest struct + Fn *LFunction + func (s *SpawnRequest) String() string + func (s *SpawnRequest) Type() LValueType + type StackFrame struct + CurrentLine int + FuncType string + Level int + Name string + Source string + func (sf StackFrame) String() string + type StackTrace struct + Frames []StackFrame + ThreadID string + func (st StackTrace) String() string + type Ternary int8 + const TernaryFalse + const TernaryTrue + const TernaryUnknown + func (t Ternary) Bool() bool + func (t Ternary) String() string + type Upvalue struct + func (uv *Upvalue) Close() + func (uv *Upvalue) IsClosed() bool + func (uv *Upvalue) SetValue(value LValue) + func (uv *Upvalue) Value() LValue + type ValidationContext struct + func DefaultValidationContext() *ValidationContext + func NewValidationContext() *ValidationContext + func (vc *ValidationContext) RegisterValidator(name string, fn ValidatorFunc) + func (vc *ValidationContext) Validate(val LValue, lt *LType) []*validate.Error + type ValidatorFunc func(val LValue, arg any) *validate.Error