luautil

package
v0.0.0-...-b178995 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2020 License: MIT Imports: 5 Imported by: 2

Documentation

Overview

Package luautil implements utility for gopher-lua.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddToPath

func AddToPath(L *lua.LState, npath string)

AddToPath append the given path the the Lua package.path

func FromJSON

func FromJSON(L *lua.LState, js []byte) lua.LValue

Convert the JSON to a Lua object ready to be pushed Adapted from https://github.com/layeh/gopher-json/blob/master/util.go (Public domain)

func InterfaceToLValue

func InterfaceToLValue(L *lua.LState, value interface{}) lua.LValue

InterfaceToLValue converts the given value to its `lua.LValue` counterpart

func TableToMap

func TableToMap(L *lua.LState, table *lua.LTable) map[string]interface{}

TableToMap converts a `*lua.LTable` to a `map[string]interface{}`

func TableToSlice

func TableToSlice(L *lua.LState, table *lua.LTable) []interface{}

TableToSlice converts a `*lua.LTable` to a `[]interface{}`

func ToJSON

func ToJSON(L *lua.LState, value lua.LValue) []byte

Convert a Lua table to JSON Adapted from https://github.com/layeh/gopher-json/blob/master/util.go (Public domain)

Types

This section is empty.

Jump to

Keyboard shortcuts

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