Documentation

Overview

    Package convert provides functions for converting to and from Lua structures

    Index

    Constants

    This section is empty.

    Variables

    This section is empty.

    Functions

    func Arguments2buffer

    func Arguments2buffer(L *lua.LState, addNewline bool) bytes.Buffer

      Arguments2buffer retrieves all the arguments given to a Lua function and gather the strings in a buffer.

      func Map2table

      func Map2table(L *lua.LState, m map[string]string) *lua.LTable

        Map2table converts a map[string]string to a Lua table

        func PprintToWriter

        func PprintToWriter(w io.Writer, value lua.LValue)

          PprintToWriter outputs more informative information than the memory location. Attempt to extract and print the values of the given lua.LValue. Does not add a newline at the end.

          func Strings2table

          func Strings2table(L *lua.LState, sl []string) *lua.LTable

            Strings2table converts a string slice to a Lua table

            func Table2interfaceMap

            func Table2interfaceMap(luaTable *lua.LTable) map[string]interface{}

              Table2interfaceMap converts a Lua table to a map[string]interface{} If values are also tables, they are also attempted converted to map[string]interface{}

              func Table2interfaceMapGlua

              func Table2interfaceMapGlua(luaTable *lua.LTable) (retmap map[interface{}]interface{}, isArray bool, err error)

                Table2interfaceMapGlua converts a Lua table to a map by using gluamapper. If the map really is an array (all the keys are indices), return true.

                func Table2map

                func Table2map(luaTable *lua.LTable, preferInt bool) (interface{}, bool)

                  Table2map converts a Lua table to **one** of the following types, depending on the content:

                  map[string]string
                  map[string]int
                  map[int]string
                  map[int]int
                  

                  If no suitable keys and values are found, a nil interface is returned. If several different types are found, it returns true.

                  func Table2maps

                  func Table2maps(luaTable *lua.LTable) (map[string]string, map[string]int, map[int]string, map[int]int)

                    Table2maps converts a Lua table to **all** of the following types, depending on the content:

                    map[string]string
                    map[string]int
                    map[int]string
                    map[int]int
                    

                    Types

                    This section is empty.

                    Source Files