seaweedfs/weed/pb/message_fbs/Message.go

120 lines
3 KiB
Go
Raw Permalink Normal View History

2022-07-18 07:25:14 +00:00
// Code generated by the FlatBuffers compiler. DO NOT EDIT.
package message_fbs
import (
flatbuffers "github.com/google/flatbuffers/go"
)
type Message struct {
_tab flatbuffers.Table
}
func GetRootAsMessage(buf []byte, offset flatbuffers.UOffsetT) *Message {
n := flatbuffers.GetUOffsetT(buf[offset:])
x := &Message{}
x.Init(buf, n+offset)
return x
}
func GetSizePrefixedRootAsMessage(buf []byte, offset flatbuffers.UOffsetT) *Message {
n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:])
x := &Message{}
x.Init(buf, n+offset+flatbuffers.SizeUint32)
return x
}
func (rcv *Message) Init(buf []byte, i flatbuffers.UOffsetT) {
rcv._tab.Bytes = buf
rcv._tab.Pos = i
}
func (rcv *Message) Table() flatbuffers.Table {
return rcv._tab
}
2022-07-22 08:12:32 +00:00
func (rcv *Message) SeqDelta() int32 {
2022-07-18 07:25:14 +00:00
o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
if o != 0 {
return rcv._tab.GetInt32(o + rcv._tab.Pos)
}
return 0
}
2022-07-22 08:12:32 +00:00
func (rcv *Message) MutateSeqDelta(n int32) bool {
2022-07-18 07:25:14 +00:00
return rcv._tab.MutateInt32Slot(4, n)
}
2022-07-22 08:12:32 +00:00
func (rcv *Message) TsMsDelta() int32 {
2022-07-18 07:25:14 +00:00
o := flatbuffers.UOffsetT(rcv._tab.Offset(6))
if o != 0 {
return rcv._tab.GetInt32(o + rcv._tab.Pos)
}
return 0
}
2022-07-22 08:12:32 +00:00
func (rcv *Message) MutateTsMsDelta(n int32) bool {
2022-07-18 07:25:14 +00:00
return rcv._tab.MutateInt32Slot(6, n)
}
func (rcv *Message) Properties(obj *NameValue, j int) bool {
2022-07-22 08:12:32 +00:00
o := flatbuffers.UOffsetT(rcv._tab.Offset(8))
2022-07-18 07:25:14 +00:00
if o != 0 {
x := rcv._tab.Vector(o)
x += flatbuffers.UOffsetT(j) * 4
x = rcv._tab.Indirect(x)
obj.Init(rcv._tab.Bytes, x)
return true
}
return false
}
func (rcv *Message) PropertiesLength() int {
2022-07-22 08:12:32 +00:00
o := flatbuffers.UOffsetT(rcv._tab.Offset(8))
2022-07-18 07:25:14 +00:00
if o != 0 {
return rcv._tab.VectorLen(o)
}
return 0
}
func (rcv *Message) Key() []byte {
2022-07-22 08:12:32 +00:00
o := flatbuffers.UOffsetT(rcv._tab.Offset(10))
2022-07-18 07:25:14 +00:00
if o != 0 {
return rcv._tab.ByteVector(o + rcv._tab.Pos)
}
return nil
}
func (rcv *Message) Data() []byte {
2022-07-22 08:12:32 +00:00
o := flatbuffers.UOffsetT(rcv._tab.Offset(12))
2022-07-18 07:25:14 +00:00
if o != 0 {
return rcv._tab.ByteVector(o + rcv._tab.Pos)
}
return nil
}
func MessageStart(builder *flatbuffers.Builder) {
2022-07-22 08:12:32 +00:00
builder.StartObject(5)
2022-07-18 07:25:14 +00:00
}
2022-07-22 08:12:32 +00:00
func MessageAddSeqDelta(builder *flatbuffers.Builder, seqDelta int32) {
builder.PrependInt32Slot(0, seqDelta, 0)
2022-07-18 07:25:14 +00:00
}
2022-07-22 08:12:32 +00:00
func MessageAddTsMsDelta(builder *flatbuffers.Builder, tsMsDelta int32) {
builder.PrependInt32Slot(1, tsMsDelta, 0)
2022-07-18 07:25:14 +00:00
}
func MessageAddProperties(builder *flatbuffers.Builder, properties flatbuffers.UOffsetT) {
2022-07-22 08:12:32 +00:00
builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(properties), 0)
2022-07-18 07:25:14 +00:00
}
func MessageStartPropertiesVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT {
return builder.StartVector(4, numElems, 4)
}
func MessageAddKey(builder *flatbuffers.Builder, key flatbuffers.UOffsetT) {
2022-07-22 08:12:32 +00:00
builder.PrependUOffsetTSlot(3, flatbuffers.UOffsetT(key), 0)
2022-07-18 07:25:14 +00:00
}
func MessageAddData(builder *flatbuffers.Builder, data flatbuffers.UOffsetT) {
2022-07-22 08:12:32 +00:00
builder.PrependUOffsetTSlot(4, flatbuffers.UOffsetT(data), 0)
2022-07-18 07:25:14 +00:00
}
func MessageEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
return builder.EndObject()
}