Typed Accessors
---
Instead of converting to JSON, you can parse Lua data into KeyValuePairs
and access values with typed getter methods. This gives you native Go types
without going through JSON marshaling.
---lua
playerName = "Jaina"
playerLevel = 60
health = 98.5
isOnline = true
settings = {
    ["showHelm"] = true,
    ["scale"] = 1.2,
}
---go
package main

import (
    "fmt"

    "github.com/mmobeus/luadata"
)

func main() {
    input := `playerName = "Jaina"
playerLevel = 60
health = 98.5
isOnline = true
settings = {
    ["showHelm"] = true,
    ["scale"] = 1.2,
}`

    data, err := luadata.ParseText("input", input)
    if err != nil {
        panic(err)
    }

    fmt.Println(data.GetString("playerName"))
    fmt.Println(data.GetInt("playerLevel"))
    fmt.Println(data.GetFloat("health"))
    fmt.Println(data.GetBool("isOnline"))

    settings := data.GetTable("settings")
    fmt.Println(settings.GetBool("showHelm"))
    fmt.Println(settings.GetFloat("scale"))
}
---output
Jaina
60
98.5
true
true
1.2
---
Each getter returns the zero value for its type if the key is missing or
the value is a different type. GetString returns "", GetInt returns 0,
GetFloat returns 0.0, GetBool returns false, and GetTable returns an
empty KeyValuePairs.
