gluaflatbuffers

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

README

Licensed under Apache V2 as the files are a derivative work of https://github.com/google/flatbuffers/tree/master/lua

This Go port exists for 3 reasons:

  1. upstream lua generator assumes 5.3 (relies on string.unpack/string.pack/integer) despite compatibiltiy shims. gopher-lua is 5.1+goto. So need the code to work with 64 bit integers while Lua 5.1 numbers are all float64
  2. their lua runtime library has some flaws, like encoding bool as ascii "0" or "1" instead of "\0" or "\1"
  3. last & definitely least, perf

There are currently some issues with flatc lua output, this fork should be used until those fixes are merged upstream

To properly support 64 byte integers, this library supports encoding UserData with Value of int64 or uint64

Documentation

Index

Constants

View Source
const VtableMetadataFields int = 2

Variables

View Source
var LuaBinaryArray = glua64.UserDataType[[]byte]{Name: "flatbuffers_binaryarray"}
View Source
var LuaBuilder = glua64.UserDataType[*Builder]{Name: "flatbuffers_builder"}
View Source
var LuaN = glua64.UserDataType[N]{Name: "flatbuffers_n"}
View Source
var LuaView = glua64.UserDataType[*View]{Name: "flatbuffers_view"}

Functions

func BinaryArrayGrow

func BinaryArrayGrow(ls *lua.LState) int

func BinaryArrayIndex

func BinaryArrayIndex(ls *lua.LState) int

func BinaryArrayLen

func BinaryArrayLen(ls *lua.LState) int

func BinaryArrayNew

func BinaryArrayNew(ls *lua.LState) int

func BinaryArrayPad

func BinaryArrayPad(ls *lua.LState) int

func BinaryArraySet

func BinaryArraySet(ls *lua.LState) int

func BinaryArraySlice

func BinaryArraySlice(ls *lua.LState) int

func BinaryArray_Loader

func BinaryArray_Loader(ls *lua.LState) int

func BuilderClear

func BuilderClear(ls *lua.LState) int

func BuilderCreateByteVector

func BuilderCreateByteVector(ls *lua.LState) int

func BuilderCreateString

func BuilderCreateString(ls *lua.LState) int

func BuilderEndObject

func BuilderEndObject(ls *lua.LState) int

func BuilderEndVector

func BuilderEndVector(ls *lua.LState) int

func BuilderFinish

func BuilderFinish(ls *lua.LState) int

func BuilderFinishSizePrefixed

func BuilderFinishSizePrefixed(ls *lua.LState) int

func BuilderHead

func BuilderHead(ls *lua.LState) int

func BuilderNew

func BuilderNew(ls *lua.LState) int

func BuilderOffset

func BuilderOffset(ls *lua.LState) int

func BuilderOutput

func BuilderOutput(ls *lua.LState) int

func BuilderPad

func BuilderPad(ls *lua.LState) int

func BuilderPlace

func BuilderPlace(ls *lua.LState) int

func BuilderPrep

func BuilderPrep(ls *lua.LState) int

func BuilderPrepend

func BuilderPrepend(ls *lua.LState) int

func BuilderPrependBool

func BuilderPrependBool(ls *lua.LState) int

func BuilderPrependBoolSlot

func BuilderPrependBoolSlot(ls *lua.LState) int

func BuilderPrependFloat32

func BuilderPrependFloat32(ls *lua.LState) int

func BuilderPrependFloat32Slot

func BuilderPrependFloat32Slot(ls *lua.LState) int

func BuilderPrependFloat64

func BuilderPrependFloat64(ls *lua.LState) int

func BuilderPrependFloat64Slot

func BuilderPrependFloat64Slot(ls *lua.LState) int

func BuilderPrependInt16

func BuilderPrependInt16(ls *lua.LState) int

func BuilderPrependInt16Slot

func BuilderPrependInt16Slot(ls *lua.LState) int

func BuilderPrependInt32

func BuilderPrependInt32(ls *lua.LState) int

func BuilderPrependInt32Slot

func BuilderPrependInt32Slot(ls *lua.LState) int

func BuilderPrependInt64

func BuilderPrependInt64(ls *lua.LState) int

func BuilderPrependInt64Slot

func BuilderPrependInt64Slot(ls *lua.LState) int

func BuilderPrependInt8

func BuilderPrependInt8(ls *lua.LState) int

func BuilderPrependInt8Slot

func BuilderPrependInt8Slot(ls *lua.LState) int

func BuilderPrependSOffsetTRelative

func BuilderPrependSOffsetTRelative(ls *lua.LState) int

func BuilderPrependSlot

func BuilderPrependSlot(ls *lua.LState) int

func BuilderPrependStructSlot

func BuilderPrependStructSlot(ls *lua.LState) int

func BuilderPrependUOffsetTRelative

func BuilderPrependUOffsetTRelative(ls *lua.LState) int

func BuilderPrependUOffsetTRelativeSlot

func BuilderPrependUOffsetTRelativeSlot(ls *lua.LState) int

func BuilderPrependUint16

func BuilderPrependUint16(ls *lua.LState) int

func BuilderPrependUint16Slot

func BuilderPrependUint16Slot(ls *lua.LState) int

func BuilderPrependUint32

func BuilderPrependUint32(ls *lua.LState) int

func BuilderPrependUint32Slot

func BuilderPrependUint32Slot(ls *lua.LState) int

func BuilderPrependUint64

func BuilderPrependUint64(ls *lua.LState) int

func BuilderPrependUint64Slot

func BuilderPrependUint64Slot(ls *lua.LState) int

func BuilderPrependUint8

func BuilderPrependUint8(ls *lua.LState) int

func BuilderPrependUint8Slot

func BuilderPrependUint8Slot(ls *lua.LState) int

func BuilderSlot

func BuilderSlot(ls *lua.LState) int

func BuilderStartObject

func BuilderStartObject(ls *lua.LState) int

func BuilderStartVector

func BuilderStartVector(ls *lua.LState) int

func BuilderWriteVtable

func BuilderWriteVtable(ls *lua.LState) int

func Builder_Loader

func Builder_Loader(ls *lua.LState) int

func CheckOffset

func CheckOffset(ls *lua.LState, idx int) int

func FinishHelper

func FinishHelper(ls *lua.LState, sizePrefix bool) int

func Loader

func Loader(ls *lua.LState) int

func NUnpack

func NUnpack(ls *lua.LState) int

func N_Loader

func N_Loader(ls *lua.LState) int

func Pad

func Pad(ba []byte, n int, start int)

func PrependHelper

func PrependHelper(ls *lua.LState, n N) int

func PrependSlotHelper

func PrependSlotHelper(ls *lua.LState, n N) int

func ViewGet

func ViewGet(ls *lua.LState) int

func ViewGetSlot

func ViewGetSlot(ls *lua.LState) int

func ViewGetVOffsetTSlot

func ViewGetVOffsetTSlot(ls *lua.LState) int

func ViewIndex

func ViewIndex(ls *lua.LState) int

func ViewIndirect

func ViewIndirect(ls *lua.LState) int

func ViewNew

func ViewNew(ls *lua.LState) int

func ViewOffset

func ViewOffset(ls *lua.LState) int

func ViewString

func ViewString(ls *lua.LState) int

func ViewUnion

func ViewUnion(ls *lua.LState) int

func ViewVector

func ViewVector(ls *lua.LState) int

func ViewVectorAsString

func ViewVectorAsString(ls *lua.LState) int

func ViewVectorLen

func ViewVectorLen(ls *lua.LState) int

func View_Loader

func View_Loader(ls *lua.LState) int

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

func (*Builder) EndVector

func (b *Builder) EndVector(ls *lua.LState, vectorSize int) int

func (*Builder) Offset

func (b *Builder) Offset() int

func (*Builder) Pad

func (b *Builder) Pad(pad int)

func (*Builder) Place

func (b *Builder) Place(ls *lua.LState, x lua.LValue, n N)

func (*Builder) PlaceU64

func (b *Builder) PlaceU64(u64 uint64, n N)

func (*Builder) Prep

func (b *Builder) Prep(width uint8, additional int)

func (*Builder) Prepend

func (b *Builder) Prepend(ls *lua.LState, n N, x lua.LValue)

func (*Builder) PrependOffsetTRelative

func (b *Builder) PrependOffsetTRelative(ls *lua.LState, off int, n N)

func (*Builder) PrependSOffsetTRelative

func (b *Builder) PrependSOffsetTRelative(ls *lua.LState, off int)

func (*Builder) PrependSlot

func (b *Builder) PrependSlot(ls *lua.LState, n N, slotnum int, x lua.LValue, d lua.LValue)

func (*Builder) PrependU64

func (b *Builder) PrependU64(n N, x uint64)

func (*Builder) PrependUOffsetTRelative

func (b *Builder) PrependUOffsetTRelative(ls *lua.LState, off int)

func (*Builder) PrependVOffsetT

func (b *Builder) PrependVOffsetT(off uint16)

func (*Builder) Slot

func (b *Builder) Slot(ls *lua.LState, slotnum int)

func (*Builder) WriteVtable

func (b *Builder) WriteVtable(ls *lua.LState) int

type N

type N struct {
	// contains filtered or unexported fields
}

func (*N) Pack

func (n *N) Pack(ls *lua.LState, buf []byte, val lua.LValue)

func (*N) PackU64

func (n *N) PackU64(buf []byte, val uint64)

func (*N) Unpack

func (n *N) Unpack(ls *lua.LState, buf []byte) lua.LValue

func (*N) UnpackU64

func (n *N) UnpackU64(buf []byte) uint64

type Ntype

type Ntype = uint8

type View

type View struct {
	// contains filtered or unexported fields
}

func (*View) Offset

func (view *View) Offset(vtoff uint16) uint16

func (*View) Vector

func (view *View) Vector(off int) int

func (*View) VectorLen

func (view *View) VectorLen(off int) uint32

Jump to

Keyboard shortcuts

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