diff options
Diffstat (limited to 'plugins/kv/payload')
-rw-r--r-- | plugins/kv/payload/generated/Item.go | 67 | ||||
-rw-r--r-- | plugins/kv/payload/generated/Payload.go | 71 | ||||
-rw-r--r-- | plugins/kv/payload/payload.fbs | 14 |
3 files changed, 152 insertions, 0 deletions
diff --git a/plugins/kv/payload/generated/Item.go b/plugins/kv/payload/generated/Item.go new file mode 100644 index 00000000..61bd6024 --- /dev/null +++ b/plugins/kv/payload/generated/Item.go @@ -0,0 +1,67 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package generated + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +type Item struct { + _tab flatbuffers.Table +} + +func GetRootAsItem(buf []byte, offset flatbuffers.UOffsetT) *Item { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &Item{} + x.Init(buf, n+offset) + return x +} + +func (rcv *Item) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *Item) Table() flatbuffers.Table { + return rcv._tab +} + +func (rcv *Item) Key() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +func (rcv *Item) Value() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +func (rcv *Item) Timeout() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +func ItemStart(builder *flatbuffers.Builder) { + builder.StartObject(3) +} +func ItemAddKey(builder *flatbuffers.Builder, Key flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(Key), 0) +} +func ItemAddValue(builder *flatbuffers.Builder, Value flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(Value), 0) +} +func ItemAddTimeout(builder *flatbuffers.Builder, Timeout flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(Timeout), 0) +} +func ItemEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/plugins/kv/payload/generated/Payload.go b/plugins/kv/payload/generated/Payload.go new file mode 100644 index 00000000..a2c6cfdb --- /dev/null +++ b/plugins/kv/payload/generated/Payload.go @@ -0,0 +1,71 @@ +// Code generated by the FlatBuffers compiler. DO NOT EDIT. + +package generated + +import ( + flatbuffers "github.com/google/flatbuffers/go" +) + +type Payload struct { + _tab flatbuffers.Table +} + +func GetRootAsPayload(buf []byte, offset flatbuffers.UOffsetT) *Payload { + n := flatbuffers.GetUOffsetT(buf[offset:]) + x := &Payload{} + x.Init(buf, n+offset) + return x +} + +func (rcv *Payload) Init(buf []byte, i flatbuffers.UOffsetT) { + rcv._tab.Bytes = buf + rcv._tab.Pos = i +} + +func (rcv *Payload) Table() flatbuffers.Table { + return rcv._tab +} + +func (rcv *Payload) Storage() []byte { + o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) + if o != 0 { + return rcv._tab.ByteVector(o + rcv._tab.Pos) + } + return nil +} + +func (rcv *Payload) Items(obj *Item, j int) bool { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + 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 *Payload) ItemsLength() int { + o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) + if o != 0 { + return rcv._tab.VectorLen(o) + } + return 0 +} + +func PayloadStart(builder *flatbuffers.Builder) { + builder.StartObject(2) +} +func PayloadAddStorage(builder *flatbuffers.Builder, Storage flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(Storage), 0) +} +func PayloadAddItems(builder *flatbuffers.Builder, Items flatbuffers.UOffsetT) { + builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(Items), 0) +} +func PayloadStartItemsVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { + return builder.StartVector(4, numElems, 4) +} +func PayloadEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { + return builder.EndObject() +} diff --git a/plugins/kv/payload/payload.fbs b/plugins/kv/payload/payload.fbs new file mode 100644 index 00000000..7e02c1a0 --- /dev/null +++ b/plugins/kv/payload/payload.fbs @@ -0,0 +1,14 @@ +namespace generated; + +table Payload { + Storage:string; + Items:[Item]; +} + +table Item { + Key:string; + Value:string; + Timeout:string; +} + +root_type Payload; |