const ( // SizeUint8 is the byte size of a uint8. SizeUint8 = 1 // SizeUint16 is the byte size of a uint16. SizeUint16 = 2 // SizeUint32 is the byte size of a uint32. SizeUint32 = 4 // SizeUint64 is the byte size of a uint64. SizeUint64 = 8 // SizeInt8 is the byte size of a int8. SizeInt8 = 1 // SizeInt16 is the byte size of a int16. SizeInt16 = 2 // SizeInt32 is the byte size of a int32. SizeInt32 = 4 // SizeInt64 is the byte size of a int64. SizeInt64 = 8 // SizeFloat32 is the byte size of a float32. SizeFloat32 = 4 // SizeFloat64 is the byte size of a float64. SizeFloat64 = 8 // SizeByte is the byte size of a byte. // The `byte` type is aliased (by Go definition) to uint8. SizeByte = 1 // SizeBool is the byte size of a bool. // The `bool` type is aliased (by flatbuffers convention) to uint8. SizeBool = 1 // SizeSOffsetT is the byte size of an SOffsetT. // The `SOffsetT` type is aliased (by flatbuffers convention) to int32. SizeSOffsetT = 4 // SizeUOffsetT is the byte size of an UOffsetT. // The `UOffsetT` type is aliased (by flatbuffers convention) to uint32. SizeUOffsetT = 4 // SizeVOffsetT is the byte size of an VOffsetT. // The `VOffsetT` type is aliased (by flatbuffers convention) to uint16. SizeVOffsetT = 2 )
const ( // VtableMetadataFields is the count of metadata fields in each vtable. VtableMetadataFields = 2 )
Codec implements gRPC-go Codec which is used to encode and decode messages.
var Codec = "flatbuffers"
func BufferHasIdentifier(buf []byte, identifier string) bool
BufferHasIdentifier checks if the identifier in a buffer has the expected value
func GetBool(buf []byte) bool
GetBool decodes a little-endian bool from a byte slice.
func GetBufferIdentifier(buf []byte) string
GetBufferIdentifier returns the file identifier as string
func GetByte(buf []byte) byte
GetByte decodes a little-endian byte from a byte slice.
func GetFloat32(buf []byte) float32
GetFloat32 decodes a little-endian float32 from a byte slice.
func GetFloat64(buf []byte) float64
GetFloat64 decodes a little-endian float64 from a byte slice.
func GetInt16(buf []byte) (n int16)
GetInt16 decodes a little-endian int16 from a byte slice.
func GetInt32(buf []byte) (n int32)
GetInt32 decodes a little-endian int32 from a byte slice.
func GetInt64(buf []byte) (n int64)
GetInt64 decodes a little-endian int64 from a byte slice.
func GetInt8(buf []byte) (n int8)
GetInt8 decodes a little-endian int8 from a byte slice.
func GetRootAs(buf []byte, offset UOffsetT, fb FlatBuffer)
GetRootAs is a generic helper to initialize a FlatBuffer with the provided buffer bytes and its data offset.
func GetSizePrefix(buf []byte, offset UOffsetT) uint32
GetSizePrefix reads the size from a size-prefixed flatbuffer
func GetSizePrefixedBufferIdentifier(buf []byte) string
GetBufferIdentifier returns the file identifier as string for a size-prefixed buffer
func GetSizePrefixedRootAs(buf []byte, offset UOffsetT, fb FlatBuffer)
GetSizePrefixedRootAs is a generic helper to initialize a FlatBuffer with the provided size-prefixed buffer bytes and its data offset
func GetUint16(buf []byte) (n uint16)
GetUint16 decodes a little-endian uint16 from a byte slice.
func GetUint32(buf []byte) (n uint32)
GetUint32 decodes a little-endian uint32 from a byte slice.
func GetUint64(buf []byte) (n uint64)
GetUint64 decodes a little-endian uint64 from a byte slice.
func GetUint8(buf []byte) (n uint8)
GetUint8 decodes a little-endian uint8 from a byte slice.
func SizePrefixedBufferHasIdentifier(buf []byte, identifier string) bool
BufferHasIdentifier checks if the identifier in a buffer has the expected value for a size-prefixed buffer
func WriteBool(buf []byte, b bool)
WriteBool encodes a little-endian bool into a byte slice.
func WriteByte(buf []byte, n byte)
WriteByte encodes a little-endian uint8 into a byte slice.
func WriteFloat32(buf []byte, n float32)
WriteFloat32 encodes a little-endian float32 into a byte slice.
func WriteFloat64(buf []byte, n float64)
WriteFloat64 encodes a little-endian float64 into a byte slice.
func WriteInt16(buf []byte, n int16)
WriteInt16 encodes a little-endian int16 into a byte slice.
func WriteInt32(buf []byte, n int32)
WriteInt32 encodes a little-endian int32 into a byte slice.
func WriteInt64(buf []byte, n int64)
WriteInt64 encodes a little-endian int64 into a byte slice.
func WriteInt8(buf []byte, n int8)
WriteInt8 encodes a little-endian int8 into a byte slice.
func WriteSOffsetT(buf []byte, n SOffsetT)
WriteSOffsetT encodes a little-endian SOffsetT into a byte slice.
func WriteUOffsetT(buf []byte, n UOffsetT)
WriteUOffsetT encodes a little-endian UOffsetT into a byte slice.
func WriteUint16(buf []byte, n uint16)
WriteUint16 encodes a little-endian uint16 into a byte slice.
func WriteUint32(buf []byte, n uint32)
WriteUint32 encodes a little-endian uint32 into a byte slice.
func WriteUint64(buf []byte, n uint64)
WriteUint64 encodes a little-endian uint64 into a byte slice.
func WriteUint8(buf []byte, n uint8)
WriteUint8 encodes a little-endian uint8 into a byte slice.
func WriteVOffsetT(buf []byte, n VOffsetT)
WriteVOffsetT encodes a little-endian VOffsetT into a byte slice.
Builder is a state machine for creating FlatBuffer objects. Use a Builder to construct object(s) starting from leaf nodes.
A Builder constructs byte buffers in a last-first manner for simplicity and performance.
type Builder struct { // `Bytes` gives raw access to the buffer. Most users will want to use // FinishedBytes() instead. Bytes []byte // contains filtered or unexported fields }
func NewBuilder(initialSize int) *Builder
NewBuilder initializes a Builder of size `initial_size`. The internal buffer is grown as needed.
func (b *Builder) CreateByteString(s []byte) UOffsetT
CreateByteString writes a byte slice as a string (null-terminated).
func (b *Builder) CreateByteVector(v []byte) UOffsetT
CreateByteVector writes a ubyte vector
func (b *Builder) CreateSharedString(s string) UOffsetT
CreateSharedString Checks if the string is already written to the buffer before calling CreateString
func (b *Builder) CreateString(s string) UOffsetT
CreateString writes a null-terminated string as a vector.
func (b *Builder) CreateVectorOfSortedTables(offsets []UOffsetT, keyCompare KeyCompare) UOffsetT
func (b *Builder) CreateVectorOfTables(offsets []UOffsetT) UOffsetT
CreateVectorOfTables serializes slice of table offsets into a vector.
func (b *Builder) EndObject() UOffsetT
EndObject writes data necessary to finish object construction.
func (b *Builder) EndVector(vectorNumElems int) UOffsetT
EndVector writes data necessary to finish vector construction.
func (b *Builder) Finish(rootTable UOffsetT)
Finish finalizes a buffer, pointing to the given `rootTable`.
func (b *Builder) FinishSizePrefixed(rootTable UOffsetT)
FinishSizePrefixed finalizes a buffer, pointing to the given `rootTable`. The buffer is prefixed with the size of the buffer, excluding the size of the prefix itself.
func (b *Builder) FinishSizePrefixedWithFileIdentifier(rootTable UOffsetT, fid []byte)
FinishSizePrefixedWithFileIdentifier finalizes a buffer, pointing to the given `rootTable` and applies a file identifier. The buffer is prefixed with the size of the buffer, excluding the size of the prefix itself.
func (b *Builder) FinishWithFileIdentifier(rootTable UOffsetT, fid []byte)
FinishWithFileIdentifier finalizes a buffer, pointing to the given `rootTable`. as well as applys a file identifier
func (b *Builder) FinishedBytes() []byte
FinishedBytes returns a pointer to the written data in the byte buffer. Panics if the builder is not in a finished state (which is caused by calling `Finish()`).
func (b *Builder) Head() UOffsetT
Head gives the start of useful data in the underlying byte buffer. Note: unlike other functions, this value is interpreted as from the left.
func (b *Builder) Offset() UOffsetT
Offset relative to the end of the buffer.
func (b *Builder) Pad(n int)
Pad places zeros at the current offset.
func (b *Builder) PlaceBool(x bool)
PlaceBool prepends a bool to the Builder, without checking for space.
func (b *Builder) PlaceByte(x byte)
PlaceByte prepends a byte to the Builder, without checking for space.
func (b *Builder) PlaceFloat32(x float32)
PlaceFloat32 prepends a float32 to the Builder, without checking for space.
func (b *Builder) PlaceFloat64(x float64)
PlaceFloat64 prepends a float64 to the Builder, without checking for space.
func (b *Builder) PlaceInt16(x int16)
PlaceInt16 prepends a int16 to the Builder, without checking for space.
func (b *Builder) PlaceInt32(x int32)
PlaceInt32 prepends a int32 to the Builder, without checking for space.
func (b *Builder) PlaceInt64(x int64)
PlaceInt64 prepends a int64 to the Builder, without checking for space.
func (b *Builder) PlaceInt8(x int8)
PlaceInt8 prepends a int8 to the Builder, without checking for space.
func (b *Builder) PlaceSOffsetT(x SOffsetT)
PlaceSOffsetT prepends a SOffsetT to the Builder, without checking for space.
func (b *Builder) PlaceUOffsetT(x UOffsetT)
PlaceUOffsetT prepends a UOffsetT to the Builder, without checking for space.
func (b *Builder) PlaceUint16(x uint16)
PlaceUint16 prepends a uint16 to the Builder, without checking for space.
func (b *Builder) PlaceUint32(x uint32)
PlaceUint32 prepends a uint32 to the Builder, without checking for space.
func (b *Builder) PlaceUint64(x uint64)
PlaceUint64 prepends a uint64 to the Builder, without checking for space.
func (b *Builder) PlaceUint8(x uint8)
PlaceUint8 prepends a uint8 to the Builder, without checking for space.
func (b *Builder) PlaceVOffsetT(x VOffsetT)
PlaceVOffsetT prepends a VOffsetT to the Builder, without checking for space.
func (b *Builder) Prep(size, additionalBytes int)
Prep prepares to write an element of `size` after `additional_bytes` have been written, e.g. if you write a string, you need to align such the int length field is aligned to SizeInt32, and the string data follows it directly. If all you need to do is align, `additionalBytes` will be 0.
func (b *Builder) PrependBool(x bool)
PrependBool prepends a bool to the Builder buffer. Aligns and checks for space.
func (b *Builder) PrependBoolSlot(o int, x, d bool)
PrependBoolSlot prepends a bool onto the object at vtable slot `o`. If value `x` equals default `d`, then the slot will be set to zero and no other data will be written.
func (b *Builder) PrependByte(x byte)
PrependByte prepends a byte to the Builder buffer. Aligns and checks for space.
func (b *Builder) PrependByteSlot(o int, x, d byte)
PrependByteSlot prepends a byte onto the object at vtable slot `o`. If value `x` equals default `d`, then the slot will be set to zero and no other data will be written.
func (b *Builder) PrependFloat32(x float32)
PrependFloat32 prepends a float32 to the Builder buffer. Aligns and checks for space.
func (b *Builder) PrependFloat32Slot(o int, x, d float32)
PrependFloat32Slot prepends a float32 onto the object at vtable slot `o`. If value `x` equals default `d`, then the slot will be set to zero and no other data will be written.
func (b *Builder) PrependFloat64(x float64)
PrependFloat64 prepends a float64 to the Builder buffer. Aligns and checks for space.
func (b *Builder) PrependFloat64Slot(o int, x, d float64)
PrependFloat64Slot prepends a float64 onto the object at vtable slot `o`. If value `x` equals default `d`, then the slot will be set to zero and no other data will be written.
func (b *Builder) PrependInt16(x int16)
PrependInt16 prepends a int16 to the Builder buffer. Aligns and checks for space.
func (b *Builder) PrependInt16Slot(o int, x, d int16)
PrependInt16Slot prepends a int16 onto the object at vtable slot `o`. If value `x` equals default `d`, then the slot will be set to zero and no other data will be written.
func (b *Builder) PrependInt32(x int32)
PrependInt32 prepends a int32 to the Builder buffer. Aligns and checks for space.
func (b *Builder) PrependInt32Slot(o int, x, d int32)
PrependInt32Slot prepends a int32 onto the object at vtable slot `o`. If value `x` equals default `d`, then the slot will be set to zero and no other data will be written.
func (b *Builder) PrependInt64(x int64)
PrependInt64 prepends a int64 to the Builder buffer. Aligns and checks for space.
func (b *Builder) PrependInt64Slot(o int, x, d int64)
PrependInt64Slot prepends a int64 onto the object at vtable slot `o`. If value `x` equals default `d`, then the slot will be set to zero and no other data will be written.
func (b *Builder) PrependInt8(x int8)
PrependInt8 prepends a int8 to the Builder buffer. Aligns and checks for space.
func (b *Builder) PrependInt8Slot(o int, x, d int8)
PrependInt8Slot prepends a int8 onto the object at vtable slot `o`. If value `x` equals default `d`, then the slot will be set to zero and no other data will be written.
func (b *Builder) PrependSOffsetT(off SOffsetT)
PrependSOffsetT prepends an SOffsetT, relative to where it will be written.
func (b *Builder) PrependStructSlot(voffset int, x, d UOffsetT)
PrependStructSlot prepends a struct onto the object at vtable slot `o`. Structs are stored inline, so nothing additional is being added. In generated code, `d` is always 0.
func (b *Builder) PrependUOffsetT(off UOffsetT)
PrependUOffsetT prepends an UOffsetT, relative to where it will be written.
func (b *Builder) PrependUOffsetTSlot(o int, x, d UOffsetT)
PrependUOffsetTSlot prepends an UOffsetT onto the object at vtable slot `o`. If value `x` equals default `d`, then the slot will be set to zero and no other data will be written.
func (b *Builder) PrependUint16(x uint16)
PrependUint16 prepends a uint16 to the Builder buffer. Aligns and checks for space.
func (b *Builder) PrependUint16Slot(o int, x, d uint16)
PrependUint16Slot prepends a uint16 onto the object at vtable slot `o`. If value `x` equals default `d`, then the slot will be set to zero and no other data will be written.
func (b *Builder) PrependUint32(x uint32)
PrependUint32 prepends a uint32 to the Builder buffer. Aligns and checks for space.
func (b *Builder) PrependUint32Slot(o int, x, d uint32)
PrependUint32Slot prepends a uint32 onto the object at vtable slot `o`. If value `x` equals default `d`, then the slot will be set to zero and no other data will be written.
func (b *Builder) PrependUint64(x uint64)
PrependUint64 prepends a uint64 to the Builder buffer. Aligns and checks for space.
func (b *Builder) PrependUint64Slot(o int, x, d uint64)
PrependUint64Slot prepends a uint64 onto the object at vtable slot `o`. If value `x` equals default `d`, then the slot will be set to zero and no other data will be written.
func (b *Builder) PrependUint8(x uint8)
PrependUint8 prepends a uint8 to the Builder buffer. Aligns and checks for space.
func (b *Builder) PrependUint8Slot(o int, x, d uint8)
PrependUint8Slot prepends a uint8 onto the object at vtable slot `o`. If value `x` equals default `d`, then the slot will be set to zero and no other data will be written.
func (b *Builder) PrependVOffsetT(x VOffsetT)
PrependVOffsetT prepends a VOffsetT to the Builder buffer. Aligns and checks for space.
func (b *Builder) Reset()
Reset truncates the underlying Builder buffer, facilitating alloc-free reuse of a Builder. It also resets bookkeeping data.
func (b *Builder) Slot(slotnum int)
Slot sets the vtable key `voffset` to the current location in the buffer.
func (b *Builder) StartObject(numfields int)
StartObject initializes bookkeeping for writing a new object.
func (b *Builder) StartVector(elemSize, numElems, alignment int) UOffsetT
StartVector initializes bookkeeping for writing a new vector.
A vector has the following format:
<UOffsetT: number of elements in this vector> <T: data>+, where T is the type of elements of this vector.
func (b *Builder) WriteVtable() (n UOffsetT)
WriteVtable serializes the vtable for the current object, if applicable.
Before writing out the vtable, this checks pre-existing vtables for equality to this one. If an equal vtable is found, point the object to the existing vtable and return.
Because vtable values are sensitive to alignment of object data, not all logically-equal vtables will be deduplicated.
A vtable has the following format:
<VOffsetT: size of the vtable in bytes, including this value> <VOffsetT: size of the object in bytes, including the vtable offset> <VOffsetT: offset for a field> * N, where N is the number of fields in the schema for this type. Includes deprecated fields.
Thus, a vtable is made of 2 + N elements, each SizeVOffsetT bytes wide.
An object has the following format:
<SOffsetT: offset to this object's vtable (may be negative)> <byte: data>+
FlatBuffer is the interface that represents a flatbuffer.
type FlatBuffer interface { Table() Table Init(buf []byte, i UOffsetT) }
FlatbuffersCodec defines the interface gRPC uses to encode and decode messages. Note that implementations of this interface must be thread safe; a Codec's methods can be called from concurrent goroutines.
type FlatbuffersCodec struct{}
func (FlatbuffersCodec) Marshal(v interface{}) ([]byte, error)
Marshal returns the wire format of v.
func (FlatbuffersCodec) Name() string
Name returns the name of the Codec implementation. The returned string will be used as part of content type in transmission. The result must be static; the result cannot change between calls.
add Name() for ForceCodec interface
func (FlatbuffersCodec) String() string
String old gRPC Codec interface func
func (FlatbuffersCodec) Unmarshal(data []byte, v interface{}) error
Unmarshal parses the wire format into v.
type KeyCompare func(o1, o2 UOffsetT, buf []byte) bool
A SOffsetT stores a signed offset into arbitrary data.
type SOffsetT int32
func GetSOffsetT(buf []byte) SOffsetT
GetSOffsetT decodes a little-endian SOffsetT from a byte slice.
Struct wraps a byte slice and provides read access to its data.
Structs do not have a vtable.
type Struct struct { Table }
Table wraps a byte slice and provides read access to its data.
The variable `Pos` indicates the root of the FlatBuffers object therein.
type Table struct { Bytes []byte Pos UOffsetT // Always < 1<<31. }
func (t *Table) ByteVector(off UOffsetT) []byte
ByteVector gets a byte slice from data stored inside the flatbuffer.
func (t *Table) GetBool(off UOffsetT) bool
GetBool retrieves a bool at the given offset.
func (t *Table) GetBoolSlot(slot VOffsetT, d bool) bool
GetBoolSlot retrieves the bool that the given vtable location points to. If the vtable value is zero, the default value `d` will be returned.
func (t *Table) GetByte(off UOffsetT) byte
GetByte retrieves a byte at the given offset.
func (t *Table) GetByteSlot(slot VOffsetT, d byte) byte
GetByteSlot retrieves the byte that the given vtable location points to. If the vtable value is zero, the default value `d` will be returned.
func (t *Table) GetFloat32(off UOffsetT) float32
GetFloat32 retrieves a float32 at the given offset.
func (t *Table) GetFloat32Slot(slot VOffsetT, d float32) float32
GetFloat32Slot retrieves the float32 that the given vtable location points to. If the vtable value is zero, the default value `d` will be returned.
func (t *Table) GetFloat64(off UOffsetT) float64
GetFloat64 retrieves a float64 at the given offset.
func (t *Table) GetFloat64Slot(slot VOffsetT, d float64) float64
GetFloat64Slot retrieves the float64 that the given vtable location points to. If the vtable value is zero, the default value `d` will be returned.
func (t *Table) GetInt16(off UOffsetT) int16
GetInt16 retrieves a int16 at the given offset.
func (t *Table) GetInt16Slot(slot VOffsetT, d int16) int16
GetInt16Slot retrieves the int16 that the given vtable location points to. If the vtable value is zero, the default value `d` will be returned.
func (t *Table) GetInt32(off UOffsetT) int32
GetInt32 retrieves a int32 at the given offset.
func (t *Table) GetInt32Slot(slot VOffsetT, d int32) int32
GetInt32Slot retrieves the int32 that the given vtable location points to. If the vtable value is zero, the default value `d` will be returned.
func (t *Table) GetInt64(off UOffsetT) int64
GetInt64 retrieves a int64 at the given offset.
func (t *Table) GetInt64Slot(slot VOffsetT, d int64) int64
GetInt64Slot retrieves the int64 that the given vtable location points to. If the vtable value is zero, the default value `d` will be returned.
func (t *Table) GetInt8(off UOffsetT) int8
GetInt8 retrieves a int8 at the given offset.
func (t *Table) GetInt8Slot(slot VOffsetT, d int8) int8
GetInt8Slot retrieves the int8 that the given vtable location points to. If the vtable value is zero, the default value `d` will be returned.
func (t *Table) GetSOffsetT(off UOffsetT) SOffsetT
GetSOffsetT retrieves a SOffsetT at the given offset.
func (t *Table) GetUOffsetT(off UOffsetT) UOffsetT
GetUOffsetT retrieves a UOffsetT at the given offset.
func (t *Table) GetUint16(off UOffsetT) uint16
GetUint16 retrieves a uint16 at the given offset.
func (t *Table) GetUint16Slot(slot VOffsetT, d uint16) uint16
GetUint16Slot retrieves the uint16 that the given vtable location points to. If the vtable value is zero, the default value `d` will be returned.
func (t *Table) GetUint32(off UOffsetT) uint32
GetUint32 retrieves a uint32 at the given offset.
func (t *Table) GetUint32Slot(slot VOffsetT, d uint32) uint32
GetUint32Slot retrieves the uint32 that the given vtable location points to. If the vtable value is zero, the default value `d` will be returned.
func (t *Table) GetUint64(off UOffsetT) uint64
GetUint64 retrieves a uint64 at the given offset.
func (t *Table) GetUint64Slot(slot VOffsetT, d uint64) uint64
GetUint64Slot retrieves the uint64 that the given vtable location points to. If the vtable value is zero, the default value `d` will be returned.
func (t *Table) GetUint8(off UOffsetT) uint8
GetUint8 retrieves a uint8 at the given offset.
func (t *Table) GetUint8Slot(slot VOffsetT, d uint8) uint8
GetUint8Slot retrieves the uint8 that the given vtable location points to. If the vtable value is zero, the default value `d` will be returned.
func (t *Table) GetVOffsetT(off UOffsetT) VOffsetT
GetVOffsetT retrieves a VOffsetT at the given offset.
func (t *Table) GetVOffsetTSlot(slot VOffsetT, d VOffsetT) VOffsetT
GetVOffsetTSlot retrieves the VOffsetT that the given vtable location points to. If the vtable value is zero, the default value `d` will be returned.
func (t *Table) Indirect(off UOffsetT) UOffsetT
Indirect retrieves the relative offset stored at `offset`.
func (t *Table) MutateBool(off UOffsetT, n bool) bool
MutateBool updates a bool at the given offset.
func (t *Table) MutateBoolSlot(slot VOffsetT, n bool) bool
MutateBoolSlot updates the bool at given vtable location
func (t *Table) MutateByte(off UOffsetT, n byte) bool
MutateByte updates a Byte at the given offset.
func (t *Table) MutateByteSlot(slot VOffsetT, n byte) bool
MutateByteSlot updates the byte at given vtable location
func (t *Table) MutateFloat32(off UOffsetT, n float32) bool
MutateFloat32 updates a Float32 at the given offset.
func (t *Table) MutateFloat32Slot(slot VOffsetT, n float32) bool
MutateFloat32Slot updates the float32 at given vtable location
func (t *Table) MutateFloat64(off UOffsetT, n float64) bool
MutateFloat64 updates a Float64 at the given offset.
func (t *Table) MutateFloat64Slot(slot VOffsetT, n float64) bool
MutateFloat64Slot updates the float64 at given vtable location
func (t *Table) MutateInt16(off UOffsetT, n int16) bool
MutateInt16 updates a Int16 at the given offset.
func (t *Table) MutateInt16Slot(slot VOffsetT, n int16) bool
MutateInt16Slot updates the int16 at given vtable location
func (t *Table) MutateInt32(off UOffsetT, n int32) bool
MutateInt32 updates a Int32 at the given offset.
func (t *Table) MutateInt32Slot(slot VOffsetT, n int32) bool
MutateInt32Slot updates the int32 at given vtable location
func (t *Table) MutateInt64(off UOffsetT, n int64) bool
MutateInt64 updates a Int64 at the given offset.
func (t *Table) MutateInt64Slot(slot VOffsetT, n int64) bool
MutateInt64Slot updates the int64 at given vtable location
func (t *Table) MutateInt8(off UOffsetT, n int8) bool
MutateInt8 updates a Int8 at the given offset.
func (t *Table) MutateInt8Slot(slot VOffsetT, n int8) bool
MutateInt8Slot updates the int8 at given vtable location
func (t *Table) MutateSOffsetT(off UOffsetT, n SOffsetT) bool
MutateSOffsetT updates a SOffsetT at the given offset.
func (t *Table) MutateUOffsetT(off UOffsetT, n UOffsetT) bool
MutateUOffsetT updates a UOffsetT at the given offset.
func (t *Table) MutateUint16(off UOffsetT, n uint16) bool
MutateUint16 updates a Uint16 at the given offset.
func (t *Table) MutateUint16Slot(slot VOffsetT, n uint16) bool
MutateUint16Slot updates the uint16 at given vtable location
func (t *Table) MutateUint32(off UOffsetT, n uint32) bool
MutateUint32 updates a Uint32 at the given offset.
func (t *Table) MutateUint32Slot(slot VOffsetT, n uint32) bool
MutateUint32Slot updates the uint32 at given vtable location
func (t *Table) MutateUint64(off UOffsetT, n uint64) bool
MutateUint64 updates a Uint64 at the given offset.
func (t *Table) MutateUint64Slot(slot VOffsetT, n uint64) bool
MutateUint64Slot updates the uint64 at given vtable location
func (t *Table) MutateUint8(off UOffsetT, n uint8) bool
MutateUint8 updates a Uint8 at the given offset.
func (t *Table) MutateUint8Slot(slot VOffsetT, n uint8) bool
MutateUint8Slot updates the uint8 at given vtable location
func (t *Table) MutateVOffsetT(off UOffsetT, n VOffsetT) bool
MutateVOffsetT updates a VOffsetT at the given offset.
func (t *Table) Offset(vtableOffset VOffsetT) VOffsetT
Offset provides access into the Table's vtable.
Fields which are deprecated are ignored by checking against the vtable's length.
func (t *Table) String(off UOffsetT) string
String gets a string from data stored inside the flatbuffer.
func (t *Table) Union(t2 *Table, off UOffsetT)
Union initializes any Table-derived type to point to the union at the given offset.
func (t *Table) Vector(off UOffsetT) UOffsetT
Vector retrieves the start of data of the vector whose offset is stored at "off" in this object.
func (t *Table) VectorLen(off UOffsetT) int
VectorLen retrieves the length of the vector whose offset is stored at "off" in this object.
A UOffsetT stores an unsigned offset into vector data.
type UOffsetT uint32
func GetIndirectOffset(buf []byte, offset UOffsetT) UOffsetT
GetIndirectOffset retrives the relative offset in the provided buffer stored at `offset`.
func GetUOffsetT(buf []byte) UOffsetT
GetUOffsetT decodes a little-endian UOffsetT from a byte slice.
A VOffsetT stores an unsigned offset in a vtable.
type VOffsetT uint16
func GetVOffsetT(buf []byte) VOffsetT
GetVOffsetT decodes a little-endian VOffsetT from a byte slice.