lua

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorFunctionNotFound = errors.New("function not found")
	ErrorNotAllowedType   = errors.New("not allowed return type")
)

Functions

This section is empty.

Types

type Lua

type Lua struct {
	// contains filtered or unexported fields
}

func New

func New() *Lua

func (*Lua) Close

func (l *Lua) Close()

func (*Lua) DoString

func (l *Lua) DoString(luaScript string) error

func (*Lua) GetGlobalTable

func (l *Lua) GetGlobalTable(name string) *lua.LTable

GetGlobalTable returns the global variable as a *lua.LTable.

func (*Lua) GetState

func (l *Lua) GetState() *lua.LState

func (*Lua) MustGetInt

func (l *Lua) MustGetInt(vGlobal string) int

func (*Lua) MustGetMap

func (l *Lua) MustGetMap(vGlobal string) map[string]string

func (*Lua) MustGetString

func (l *Lua) MustGetString(vGlobal string) string

func (*Lua) MustGetTable

func (l *Lua) MustGetTable(vGlobal string) []string

func (*Lua) NewTable

func (l *Lua) NewTable() *lua.LTable

func (*Lua) SetFunction

func (l *Lua) SetFunction(name string, f func(*lua.LState) int)

func (*Lua) SetGlobal

func (l *Lua) SetGlobal(name string, value any)

func (*Lua) SetGlobalTable

func (l *Lua) SetGlobalTable(name string, tbl *lua.LTable)

SetGlobalTable sets a global variable with a given *lua.LTable.

Jump to

Keyboard shortcuts

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