Versions in this module Expand all Collapse all v1 v1.1.0 Oct 20, 2026 v1.0.0 Oct 18, 2026 v0 v0.5.0 Oct 17, 2026 Changes in this version type Call + func (c *Call) LiveBytes() int64 type VM + func (vm *VM) LiveBytes() int64 v0.4.2 Oct 17, 2026 Changes in this version type TypeOption + func Mutable() TypeOption v0.4.1 Oct 17, 2026 v0.4.0 Oct 17, 2026 Changes in this version type Call + func (c *Call) ArgError(i int, msg string) error type VM + func (vm *VM) Function(ch *Chunk) Value v0.3.0 Oct 15, 2026 Changes in this version + func Terminate(err error) error type Call + func (c *Call) Renew() + type Chunk struct + func Compile(name, src string) (*Chunk, error) type Option + func ChunkLoader(find func(ctx context.Context, name string) (*Chunk, error)) Option + func OutputFunc(f func(ctx context.Context, s string) error) Option + func Without(names ...string) Option v0.2.0 Oct 15, 2026 v0.1.1 Oct 15, 2026 v0.1.0 Oct 15, 2026 Changes in this version + const NoLimit + var ErrAlloc = errors.New("glua: allocation limit exceeded") + var ErrHostDepth = errors.New("glua: too many nested calls between Go and Lua") + var ErrNotFunction = errors.New("glua: value is not a function") + var ErrSteps = errors.New("glua: step limit exceeded") + var ErrUndefined = errors.New("glua: name is not defined") + func Eval[R any](ctx context.Context, src string) (R, error) + func SetHashSeed(seed uint64) + type BindError struct + Name string + Reason string + Type reflect.Type + func (e *BindError) Error() string + type Call struct + func (c *Call) Arg[T any](i int) T + func (c *Call) Charge(n int) error + func (c *Call) Context() context.Context + func (c *Call) Errorf(format string, args ...any) error + func (c *Call) Invoke(fn Value, args ...Value) (Value, error) + func (c *Call) InvokeN(dst []Value, fn Value, args ...Value) ([]Value, error) + func (c *Call) Len() int + func (c *Call) Opt[T any](i int, def T) T + func (c *Call) Return2[T, U any](v T, u U) error + func (c *Call) ReturnValues(vs ...Value) error + func (c *Call) Return[T any](v T) error + func (c *Call) Value(i int) Value + type CallStats struct + AllocBytes int64 + Err error + Func string + Script string + Steps int64 + type Error struct + Value Value + func (e *Error) Error() string + func (e *Error) Traceback() []Frame + func (e *Error) Unwrap() error + type Frame struct + Function string + Line int + Source string + type GoFunc func(c *Call) error + func Do0(f func()) GoFunc + func Do0E(f func() error) GoFunc + func Do1E[A any](f func(A) error) GoFunc + func Do1[A any](f func(A)) GoFunc + func Do2E[A, B any](f func(A, B) error) GoFunc + func Do2[A, B any](f func(A, B)) GoFunc + func Do3E[A, B, C any](f func(A, B, C) error) GoFunc + func Do3[A, B, C any](f func(A, B, C)) GoFunc + func Fn0E[R any](f func() (R, error)) GoFunc + func Fn0[R any](f func() R) GoFunc + func Fn1E[A, R any](f func(A) (R, error)) GoFunc + func Fn1[A, R any](f func(A) R) GoFunc + func Fn2E[A, B, R any](f func(A, B) (R, error)) GoFunc + func Fn2[A, B, R any](f func(A, B) R) GoFunc + func Fn3E[A, B, C, R any](f func(A, B, C) (R, error)) GoFunc + func Fn3[A, B, C, R any](f func(A, B, C) R) GoFunc + func Reflect(fn any) GoFunc + type Kind uint8 + const KindBool + const KindFloat + const KindFunction + const KindInt + const KindNil + const KindString + const KindTable + const KindThread + const KindUserdata + func (k Kind) String() string + type Lib uint + const LibBase + const LibCoroutine + const LibIO + const LibLoad + const LibMath + const LibNone + const LibOS + const LibSafe + const LibString + const LibTable + const LibUTF8 + func (l Lib) String() string + type Limits struct + AllocBytes int64 + CallDepth int + HostDepth int + InitAllocBytes int64 + InitSteps int64 + Steps int64 + type Members map[string]any + type Option interface + func AutoBind(on bool) Option + func Clock(now func() time.Time) Option + func Convert[T any](enc func(T) Value, dec func(Value) (T, error)) Option + func Global(name string, v any) Option + func Hardened() Option + func Loader(find func(name string) (src string, err error)) Option + func Module(name string, members Members) Option + func Observe(f func(CallStats)) Option + func Output(w io.Writer) Option + func RandSeed(seed uint64) Option + func RecoverPanics() Option + func SourceModule(name, src string) Option + func StrictGlobals() Option + func Type[T any](opts ...TypeOption) Option + type Pair struct + First A + Second B + type PanicError struct + Stack []byte + Value any + func (e *PanicError) Error() string + type Rule struct + func (ru *Rule[E, R]) Eval(ctx context.Context, env *E) (r R, err error) + type Runtime struct + func MustNew(opts ...Option) *Runtime + func New(opts ...Option) (*Runtime, error) + func (rt *Runtime) Expr[E, R any](name, src string) (*Rule[E, R], error) + func (rt *Runtime) Load(ctx context.Context, name, src string) (*Script, error) + type Script struct + func (s *Script) Call(ctx context.Context, fn Value, args ...Value) (Value, error) + func (s *Script) CallN(ctx context.Context, dst []Value, fn Value, args ...Value) ([]Value, error) + func (s *Script) Func0[R any](name string) (func(context.Context) (R, error), error) + func (s *Script) Func1[A, R any](name string) (func(context.Context, A) (R, error), error) + func (s *Script) Func2[A, B, R any](name string) (func(context.Context, A, B) (R, error), error) + func (s *Script) Func3[A, B, C, R any](name string) (func(context.Context, A, B, C) (R, error), error) + func (s *Script) Get[T any](name string) (T, error) + func (s *Script) Globals() *Table + func (s *Script) NewVM(ctx context.Context) (*VM, error) + func (s *Script) Result() Value + func (s *Script) WithLimits(l Limits) (*Script, error) + type SyntaxError struct + Col int + Line int + Msg string + Source string + func (e *SyntaxError) Error() string + type Table struct + func NewTable(narr, nhash int) *Table + func (t *Table) All() iter.Seq2[Value, Value] + func (t *Table) Field[T any](name string) (T, error) + func (t *Table) Freeze() error + func (t *Table) Frozen() bool + func (t *Table) Get(key Value) Value + func (t *Table) Items() iter.Seq2[int, Value] + func (t *Table) Len() int + func (t *Table) Next(key Value) (k, v Value, ok bool) + func (t *Table) Set(key, val Value) + func (t *Table) SetField[T any](name string, v T) + type TypeOption interface + func Hide(fields ...string) TypeOption + func Meta(event string, f GoFunc) TypeOption + func Method(name string, f GoFunc) TypeOption + func Rename(field, luaName string) TypeOption + func Writable(fields ...string) TypeOption + type VM struct + func (vm *VM) Call(ctx context.Context, fn Value, args ...Value) (Value, error) + func (vm *VM) CallN(ctx context.Context, dst []Value, fn Value, args ...Value) ([]Value, error) + func (vm *VM) Func0[R any](name string) (func(context.Context) (R, error), error) + func (vm *VM) Func1[A, R any](name string) (func(context.Context, A) (R, error), error) + func (vm *VM) Func2[A, B, R any](name string) (func(context.Context, A, B) (R, error), error) + func (vm *VM) Func3[A, B, C, R any](name string) (func(context.Context, A, B, C) (R, error), error) + func (vm *VM) Get[T any](name string) (T, error) + func (vm *VM) Globals() *Table + func (vm *VM) Set[T any](name string, v T) error + type Value struct + func Bool(b bool) Value + func Float(f float64) Value + func Int(i int64) Value + func String(s string) Value + func ValueOf[T any](v T) Value + func (v Value) As[T any]() (T, error) + func (v Value) Equal(w Value) bool + func (v Value) Float() (float64, bool) + func (v Value) Int() (int64, bool) + func (v Value) IsNil() bool + func (v Value) Kind() Kind + func (v Value) Str() (string, bool) + func (v Value) String() string + func (v Value) Truthy() bool