json

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: Unlicense Imports: 3 Imported by: 0

README

gopher-json GoDoc

Package json is a simple JSON encoder/decoder for gopher-lua. It is based on gopher-json from layeh and adds the functionality to encode sparse arrays.

License

Public domain

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(L *lua.LState, data []byte) (lua.LValue, error)

Decode converts the JSON encoded data to Lua values.

func DecodeValue

func DecodeValue(L *lua.LState, value interface{}) lua.LValue

DecodeValue converts the value to a Lua value.

This function only converts values that the encoding/json package decodes to. All other values will return lua.LNil.

func Encode

func Encode(value lua.LValue) ([]byte, error)

Encode returns the JSON encoding of value.

func Loader

func Loader(L *lua.LState) int

Loader is the module loader function.

func Preload

func Preload(L *lua.LState)

Preload adds json to the given Lua state's package.preload table. After it has been preloaded, it can be loaded using require:

local json = require("json")

Types

This section is empty.

Jump to

Keyboard shortcuts

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