NameValue.go 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // Code generated by the FlatBuffers compiler. DO NOT EDIT.
  2. package message_fbs
  3. import (
  4. flatbuffers "github.com/google/flatbuffers/go"
  5. )
  6. type NameValue struct {
  7. _tab flatbuffers.Table
  8. }
  9. func GetRootAsNameValue(buf []byte, offset flatbuffers.UOffsetT) *NameValue {
  10. n := flatbuffers.GetUOffsetT(buf[offset:])
  11. x := &NameValue{}
  12. x.Init(buf, n+offset)
  13. return x
  14. }
  15. func GetSizePrefixedRootAsNameValue(buf []byte, offset flatbuffers.UOffsetT) *NameValue {
  16. n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:])
  17. x := &NameValue{}
  18. x.Init(buf, n+offset+flatbuffers.SizeUint32)
  19. return x
  20. }
  21. func (rcv *NameValue) Init(buf []byte, i flatbuffers.UOffsetT) {
  22. rcv._tab.Bytes = buf
  23. rcv._tab.Pos = i
  24. }
  25. func (rcv *NameValue) Table() flatbuffers.Table {
  26. return rcv._tab
  27. }
  28. func (rcv *NameValue) Name() []byte {
  29. o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
  30. if o != 0 {
  31. return rcv._tab.ByteVector(o + rcv._tab.Pos)
  32. }
  33. return nil
  34. }
  35. func (rcv *NameValue) Value() []byte {
  36. o := flatbuffers.UOffsetT(rcv._tab.Offset(6))
  37. if o != 0 {
  38. return rcv._tab.ByteVector(o + rcv._tab.Pos)
  39. }
  40. return nil
  41. }
  42. func NameValueStart(builder *flatbuffers.Builder) {
  43. builder.StartObject(2)
  44. }
  45. func NameValueAddName(builder *flatbuffers.Builder, name flatbuffers.UOffsetT) {
  46. builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(name), 0)
  47. }
  48. func NameValueAddValue(builder *flatbuffers.Builder, value flatbuffers.UOffsetT) {
  49. builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(value), 0)
  50. }
  51. func NameValueEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
  52. return builder.EndObject()
  53. }