util

package
v1.31.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2024 License: Apache-2.0, MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCannotPull     = errors.New("cannot pull go type into lua")
	ErrStackExhausted = errors.New("pull table, stack exhausted")
)

Functions

func DeepPush

func DeepPush(l *lua.State, v interface{}) int

DeepPush will put any basic Go type on the lua stack. If the value contains a map or a slice, it will recursively push those values as tables on the Lua stack.

Supported types are:

| Go                       | Lua
|-------------------------------------------------------------------------
| nil                      | nil
| bool                     | bool
| string                   | string
| any int                  | number (float64)
| any float                | number (float64)
| any complex              | number (real value as float64)
|                          |
| map[t]t                  | table, key and val `t` recursively
|                          | resolved
|                          |
| []t                      | table with array properties, with `t`
|                          | values recursively resolved

func Open

func Open(l *lua.State)

func PullStringTable

func PullStringTable(l *lua.State, idx int) (map[string]string, error)

func PullTable

func PullTable(l *lua.State, idx int) (interface{}, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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