MessagePack for Lua.
package main
import (
"ofunc/lmodmsgpack"
"ofunc/lua/util"
)
func main() {
l := util.NewState()
l.Preload("msgpack", lmodmsgpack.Open)
util.Run(l, "main.lua")
}
local msgpack = require 'msgpack'
local x = msgpack.encode(v)
local y = msgpack.decode(x)
Encodes the values.
If writer w
is provided, the encoded data will be writed to w
.
Otherwise, the encoded data will be returned.
Decodes the fisrt value.
x
can be a reader or a string.
i
is the start position of the string, default value is 1
.