Documentation ¶
Index ¶
- func IsNil(v lua.LValue) bool
- func LTableGetBool(t *lua.LTable, key string) bool
- func LTableGetFloat32(t *lua.LTable, key string) float32
- func LTableGetFloat64(t *lua.LTable, key string) float64
- func LTableGetInt(t *lua.LTable, key string) int
- func LTableGetInt16(t *lua.LTable, key string) int16
- func LTableGetInt32(t *lua.LTable, key string) int32
- func LTableGetInt64(t *lua.LTable, key string) int64
- func LTableGetInt8(t *lua.LTable, key string) int8
- func LTableGetString(t *lua.LTable, key string) string
- func LTableGetUint(t *lua.LTable, key string) uint
- func LTableGetUint16(t *lua.LTable, key string) uint16
- func LTableGetUint32(t *lua.LTable, key string) uint32
- func LTableGetUint64(t *lua.LTable, key string) uint64
- func LTableGetUint8(t *lua.LTable, key string) uint8
- func LTableToDict(t *lua.LTable) map[Value]Value
- func LTableToMap(t *lua.LTable) map[string]Value
- func LValueToBool(v lua.LValue) bool
- func LValueToDict(v lua.LValue) map[Value]Value
- func LValueToFloat32(v lua.LValue) float32
- func LValueToFloat64(v lua.LValue) float64
- func LValueToInt(v lua.LValue) int
- func LValueToInt16(v lua.LValue) int16
- func LValueToInt32(v lua.LValue) int32
- func LValueToInt64(v lua.LValue) int64
- func LValueToInt8(v lua.LValue) int8
- func LValueToMap(v lua.LValue) map[string]Value
- func LValueToString(v lua.LValue) string
- func LValueToUint(v lua.LValue) uint
- func LValueToUint16(v lua.LValue) uint16
- func LValueToUint32(v lua.LValue) uint32
- func LValueToUint64(v lua.LValue) uint64
- func LValueToUint8(v lua.LValue) uint8
- type Options
- type Table
- func (t Table) ArrayForEach(fn func(k int, v Value))
- func (t Table) ArrayLen() int
- func (t Table) DictForEach(fn func(k, v Value))
- func (t Table) DictLen() int
- func (t Table) ForEach(fn func(k, v Value))
- func (t Table) Get(key string) Value
- func (t Table) GetBool(key string) bool
- func (t Table) GetFloat32(key string) float32
- func (t Table) GetFloat64(key string) float64
- func (t Table) GetInt(key string) int
- func (t Table) GetInt16(key string) int16
- func (t Table) GetInt32(key string) int32
- func (t Table) GetInt64(key string) int64
- func (t Table) GetInt8(key string) int8
- func (t Table) GetString(key string) string
- func (t Table) GetTable(key string) Table
- func (t Table) GetUint(key string) uint
- func (t Table) GetUint16(key string) uint16
- func (t Table) GetUint32(key string) uint32
- func (t Table) GetUint64(key string) uint64
- func (t Table) GetUint8(key string) uint8
- func (t Table) Index(index int) Value
- func (t Table) LTable() *lua.LTable
- func (t Table) MapForEach(fn func(k string, v Value))
- func (t Table) MapLen() int
- func (t Table) Next(key Value) (Value, Value)
- func (t Table) ToArray() []Value
- func (t Table) ToDict() map[Value]Value
- func (t Table) ToMap() map[string]Value
- type VM
- type Value
- func (v Value) IsNil() bool
- func (v Value) LValue() lua.LValue
- func (v Value) String() string
- func (v Value) ToBool() bool
- func (v Value) ToFloat32() float32
- func (v Value) ToFloat64() float64
- func (v Value) ToInt() int
- func (v Value) ToInt16() int16
- func (v Value) ToInt32() int32
- func (v Value) ToInt64() int64
- func (v Value) ToInt8() int8
- func (v Value) ToString() string
- func (v Value) ToTable() Table
- func (v Value) ToUint() uint
- func (v Value) ToUint16() uint16
- func (v Value) ToUint32() uint32
- func (v Value) ToUint64() uint64
- func (v Value) ToUint8() uint8
- func (v Value) Type() lua.LValueType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LTableGetBool ¶
LTableGetBool is a convenience function to get a bool value from a lua.LTable using a string key.
func LTableGetFloat32 ¶
LTableGetFloat32 is a convenience function to get a float32 value from a lua.LTable using a string key.
func LTableGetFloat64 ¶
LTableGetFloat64 is a convenience function to get a float64 value from a lua.LTable using a string key.
func LTableGetInt ¶
LTableGetInt is a convenience function to get an int value from a lua.LTable using a string key.
func LTableGetInt16 ¶
LTableGetInt16 is a convenience function to get an int16 value from a lua.LTable using a string key.
func LTableGetInt32 ¶
LTableGetInt32 is a convenience function to get an int32 value from a lua.LTable using a string key.
func LTableGetInt64 ¶
LTableGetInt64 is a convenience function to get an int64 value from a lua.LTable using a string key.
func LTableGetInt8 ¶
LTableGetInt8 is a convenience function to get an int8 value from a lua.LTable using a string key.
func LTableGetString ¶
LTableGetString is a convenience function to get a string value from a lua.LTable using a string key.
func LTableGetUint ¶
LTableGetUint is a convenience function to get a uint value from a lua.LTable using a string key.
func LTableGetUint16 ¶
LTableGetUint16 is a convenience function to get a uint16 value from a lua.LTable using a string key.
func LTableGetUint32 ¶
LTableGetUint32 is a convenience function to get a uint32 value from a lua.LTable using a string key.
func LTableGetUint64 ¶
LTableGetUint64 is a convenience function to get a uint64 value from a lua.LTable using a string key.
func LTableGetUint8 ¶
LTableGetUint8 is a convenience function to get a uint8 value from a lua.LTable using a string key.
func LTableToDict ¶
LTableToDict converts the lua.LTable to a map of Value to Value.
func LTableToMap ¶
LTableToMap converts the lua.LTable to a map of string to Value.
func LValueToBool ¶
LValueToBool retrieves the bool value from a lua.LValue.
func LValueToDict ¶
LValueToDict retrieves the dict of value from a lua.LValue.
func LValueToFloat32 ¶
LValueToFloat32 retrieves the float32 value from a lua.LValue.
func LValueToFloat64 ¶
LValueToFloat64 retrieves the float64 value from a lua.LValue.
func LValueToInt ¶
LValueToInt retrieves the int value from a lua.LValue.
func LValueToInt16 ¶
LValueToInt16 retrieves the int16 value from a lua.LValue.
func LValueToInt32 ¶
LValueToInt32 retrieves the int32 value from a lua.LValue.
func LValueToInt64 ¶
LValueToInt64 retrieves the int64 value from a lua.LValue.
func LValueToInt8 ¶
LValueToInt8 retrieves the int8 value from a lua.LValue.
func LValueToMap ¶
LValueToMap retrieves the map of value from a lua.LValue.
func LValueToString ¶
LValueToString retrieves the string value from a lua.LValue.
func LValueToUint ¶
LValueToUint retrieves the uint value from a lua.LValue.
func LValueToUint16 ¶
LValueToUint16 retrieves the uint16 value from a lua.LValue.
func LValueToUint32 ¶
LValueToUint32 retrieves the uint32 value from a lua.LValue.
func LValueToUint64 ¶
LValueToUint64 retrieves the uint64 value from a lua.LValue.
func LValueToUint8 ¶
LValueToUint8 retrieves the uint8 value from a lua.LValue.
Types ¶
type Options ¶
Options is an alias for lua.Options to represent the options used when creating a Lua VM.
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
Table is a wrapper type for lua.LTable
func LTableGetTable ¶
LTableGetTable is a convenience function to get a table value from a lua.LTable using a string key.
func LValueToTable ¶
LValueToTable retrieves the map of value from a lua.LValue.
func (Table) ArrayForEach ¶
ArrayForEach iterates over the table array using a function.
func (Table) DictForEach ¶
DictForEach iterates over the table dict using a function.
func (Table) DictLen ¶
DictLen returns the length of the table dict. due to the limitation of Lua virtual machine, we can only traverse to get the length
func (Table) GetFloat32 ¶
GetFloat32 retrieves a float32 value from the table using a string key.
func (Table) GetFloat64 ¶
GetFloat64 retrieves a float64 value from the table using a string key.
func (Table) MapForEach ¶
MapForEach iterates over the table map using a function.
func (Table) MapLen ¶
MapLen returns the length of the table map. due to the limitation of Lua virtual machine, we can only traverse to get the length
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
Value is a custom type that wraps a lua.LValue.
func LTableGet ¶
LTableGet is a convenience function to get a value from a lua.LTable using a string key.
func LTableIndex ¶
LTableIndex is a convenience function to get a value from a lua.LTable using an int key.
func LTableToArray ¶
LTableToArray converts the lua.LTable to a slice of Value.
func LValueToArray ¶
LValueToArray retrieves the array of value from a lua.LValue
func (Value) String ¶
String returns the string representation of the wrapped value if it's not nil, otherwise an empty string.
func (Value) ToBool ¶
ToBool retrieves the bool value from the wrapped lua.LValue if it's of type boolean.
func (Value) ToFloat32 ¶
ToFloat32 retrieves the float32 value from the wrapped lua.LValue if it's of type number.
func (Value) ToFloat64 ¶
ToFloat64 retrieves the float64 value from the wrapped lua.LValue if it's of type number.
func (Value) ToInt ¶
ToInt retrieves the int value from the wrapped lua.LValue if it's of type number.
func (Value) ToInt16 ¶
ToInt16 retrieves the int16 value from the wrapped lua.LValue if it's of type number.
func (Value) ToInt32 ¶
ToInt32 retrieves the int32 value from the wrapped lua.LValue if it's of type number.
func (Value) ToInt64 ¶
ToInt64 retrieves the int64 value from the wrapped lua.LValue if it's of type number.
func (Value) ToInt8 ¶
ToInt8 retrieves the int8 value from the wrapped lua.LValue if it's of type number.
func (Value) ToString ¶
ToString retrieves the string value from the wrapped lua.LValue if it's of type string.
func (Value) ToTable ¶
ToTable retrieves the table value from the wrapped lua.LValue if it's of type table.
func (Value) ToUint ¶
ToUint retrieves the uint value from the wrapped lua.LValue if it's of type number.
func (Value) ToUint16 ¶
ToUint16 retrieves the uint16 value from the wrapped lua.LValue if it's of type number.
func (Value) ToUint32 ¶
ToUint32 retrieves the uint32 value from the wrapped lua.LValue if it's of type number.
func (Value) ToUint64 ¶
ToUint64 retrieves the uint64 value from the wrapped lua.LValue if it's of type number.
func (Value) ToUint8 ¶
ToUint8 retrieves the uint8 value from the wrapped lua.LValue if it's of type number.
func (Value) Type ¶
func (v Value) Type() lua.LValueType
Type returns the type of the wrapped lua.LValue.