parser

package module
v0.0.0-...-19d77dd Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2021 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

go-lua-table-parser

A simple go package which takes a lua table as input and parses it to a map[string]interface{} where interface{} is either more map[string]interface{} or map[string]string.

This package uses the github.com/yuin/gopher-lua package.

Usage:

import parser "github.com/uberswe/go-lua-table-parser"

luaString := `Vars =
{
    ["key"] = 
    {
        ["someOtherKey"] = "value"
    }
}`

func main() {
    parser.Parse(luaString, "Vars")
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(s string, variable string) (map[string]interface{}, error)

Parse takes a lua table as a string (s) and then the variable name of the lua table as arguments and returns a map[string]interface{} where interface{} is either more map[string]interface{} or map[string]string

func ParseByLState

func ParseByLState(l *lua.LState, variable string) (map[string]interface{}, error)

ParseByLState require "*lua.LState" and the name of table/variable

func ParseFile

func ParseFile(f *os.File, variable string) (map[string]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
⌂ 换网址