Back to godoc.org
a4.io/blobstash / pkg / apps / luautil

Package luautil

v0.0.0-...-b3026eb
Latest Go to latest

The highest tagged major version is .

Published: May 14, 2020 | License: MIT | Module: a4.io/blobstash

Overview

Package luautil implements utility for gopher-lua.

Index

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)

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier