luautil

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2021 License: CC0-1.0, CC0-1.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBool

func GetBool(t *rt.Table, key ...string) (b bool, wasSet bool, err error)

GetBool returns the value for the given key in the given table as a bool. The boolean wasSet will be true iff the value was non-nil (regardless of type). If the value was non-nil but could not be converted to a bool then err will describe an error.

func GetFloat64

func GetFloat64(t *rt.Table, key ...string) (f float64, wasSet bool, err error)

GetFloat64 returns the value for the given key in the given table as a float64. The boolean wasSet will be true iff the value was non-nil (regardless of type). If the value was non-nil but could not be converted to a float64 then err will describe an error.

func GetInt

func GetInt(t *rt.Table, key ...string) (n int, wasSet bool, err error)

GetInt returns the value for the given key in the given table as an int. The boolean wasSet will be true iff the value was non-nil (regardless of type). If the value was non-nil but could not be converted to an int then err will describe an error.

func GetInt64

func GetInt64(t *rt.Table, key ...string) (n int64, wasSet bool, err error)

GetInt64 returns the value for the given key in the given table as an int64. The boolean wasSet will be true iff the value was non-nil (regardless of type). If the value was non-nil but could not be converted to an int64 then err will describe an error.

func GetString

func GetString(t *rt.Table, key ...string) (s string, wasSet bool, err error)

GetString returns the value for the given key in the given table as a string. The boolean wasSet will be true iff the value was non-nil (regardless of type). If the value was non-nil but could not be converted to a string then err will describe an error.

func GetTable

func GetTable(t *rt.Table, key ...string) (tab *rt.Table, wasSet bool, err error)

GetTable returns the value for the given key in the given table as a table. The boolean wasSet will be true iff the value was non-nil (regardless of type). If the value was non-nil but could not be converted to a table then err will describe an error.

func SetBool

func SetBool(t *rt.Table, key string, b bool)

SetBool sets the value for the given key in the given table to be b.

func SetFloat64

func SetFloat64(t *rt.Table, key string, f float64)

SetFloat64 sets the value for the given key in the given table to be f.

func SetInt

func SetInt(t *rt.Table, key string, n int)

SetInt sets the value for the given key in the given table to be n.

func SetInt64

func SetInt64(t *rt.Table, key string, n int64)

SetInt64 sets the value for the given key in the given table to be n.

func SetString

func SetString(t *rt.Table, key string, s string)

SetString sets the value for the given key in the given table to be s.

func Subtable

func Subtable(t *rt.Table, name ...string) (*rt.Table, error)

Subtable returns the table in t referred to by name. More precisely, it returns t[<name[0]>][<name[1]>][...], or an error if any of the values are not a table.

Types

This section is empty.

Jump to

Keyboard shortcuts

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