You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

179 lines
4.4 KiB

  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 Message struct {
  7. _tab flatbuffers.Table
  8. }
  9. func GetRootAsMessage(buf []byte, offset flatbuffers.UOffsetT) *Message {
  10. n := flatbuffers.GetUOffsetT(buf[offset:])
  11. x := &Message{}
  12. x.Init(buf, n+offset)
  13. return x
  14. }
  15. func GetSizePrefixedRootAsMessage(buf []byte, offset flatbuffers.UOffsetT) *Message {
  16. n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:])
  17. x := &Message{}
  18. x.Init(buf, n+offset+flatbuffers.SizeUint32)
  19. return x
  20. }
  21. func (rcv *Message) Init(buf []byte, i flatbuffers.UOffsetT) {
  22. rcv._tab.Bytes = buf
  23. rcv._tab.Pos = i
  24. }
  25. func (rcv *Message) Table() flatbuffers.Table {
  26. return rcv._tab
  27. }
  28. func (rcv *Message) ProducerId() int32 {
  29. o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
  30. if o != 0 {
  31. return rcv._tab.GetInt32(o + rcv._tab.Pos)
  32. }
  33. return 0
  34. }
  35. func (rcv *Message) MutateProducerId(n int32) bool {
  36. return rcv._tab.MutateInt32Slot(4, n)
  37. }
  38. func (rcv *Message) SegmentId() int32 {
  39. o := flatbuffers.UOffsetT(rcv._tab.Offset(6))
  40. if o != 0 {
  41. return rcv._tab.GetInt32(o + rcv._tab.Pos)
  42. }
  43. return 0
  44. }
  45. func (rcv *Message) MutateSegmentId(n int32) bool {
  46. return rcv._tab.MutateInt32Slot(6, n)
  47. }
  48. func (rcv *Message) ProducerSeq() int64 {
  49. o := flatbuffers.UOffsetT(rcv._tab.Offset(8))
  50. if o != 0 {
  51. return rcv._tab.GetInt64(o + rcv._tab.Pos)
  52. }
  53. return 0
  54. }
  55. func (rcv *Message) MutateProducerSeq(n int64) bool {
  56. return rcv._tab.MutateInt64Slot(8, n)
  57. }
  58. func (rcv *Message) SegmentSeq() int64 {
  59. o := flatbuffers.UOffsetT(rcv._tab.Offset(10))
  60. if o != 0 {
  61. return rcv._tab.GetInt64(o + rcv._tab.Pos)
  62. }
  63. return 0
  64. }
  65. func (rcv *Message) MutateSegmentSeq(n int64) bool {
  66. return rcv._tab.MutateInt64Slot(10, n)
  67. }
  68. func (rcv *Message) EventTsNs() int64 {
  69. o := flatbuffers.UOffsetT(rcv._tab.Offset(12))
  70. if o != 0 {
  71. return rcv._tab.GetInt64(o + rcv._tab.Pos)
  72. }
  73. return 0
  74. }
  75. func (rcv *Message) MutateEventTsNs(n int64) bool {
  76. return rcv._tab.MutateInt64Slot(12, n)
  77. }
  78. func (rcv *Message) RecvTsNs() int64 {
  79. o := flatbuffers.UOffsetT(rcv._tab.Offset(14))
  80. if o != 0 {
  81. return rcv._tab.GetInt64(o + rcv._tab.Pos)
  82. }
  83. return 0
  84. }
  85. func (rcv *Message) MutateRecvTsNs(n int64) bool {
  86. return rcv._tab.MutateInt64Slot(14, n)
  87. }
  88. func (rcv *Message) Properties(obj *NameValue, j int) bool {
  89. o := flatbuffers.UOffsetT(rcv._tab.Offset(16))
  90. if o != 0 {
  91. x := rcv._tab.Vector(o)
  92. x += flatbuffers.UOffsetT(j) * 4
  93. x = rcv._tab.Indirect(x)
  94. obj.Init(rcv._tab.Bytes, x)
  95. return true
  96. }
  97. return false
  98. }
  99. func (rcv *Message) PropertiesLength() int {
  100. o := flatbuffers.UOffsetT(rcv._tab.Offset(16))
  101. if o != 0 {
  102. return rcv._tab.VectorLen(o)
  103. }
  104. return 0
  105. }
  106. func (rcv *Message) Key() []byte {
  107. o := flatbuffers.UOffsetT(rcv._tab.Offset(18))
  108. if o != 0 {
  109. return rcv._tab.ByteVector(o + rcv._tab.Pos)
  110. }
  111. return nil
  112. }
  113. func (rcv *Message) Data() []byte {
  114. o := flatbuffers.UOffsetT(rcv._tab.Offset(20))
  115. if o != 0 {
  116. return rcv._tab.ByteVector(o + rcv._tab.Pos)
  117. }
  118. return nil
  119. }
  120. func MessageStart(builder *flatbuffers.Builder) {
  121. builder.StartObject(9)
  122. }
  123. func MessageAddProducerId(builder *flatbuffers.Builder, producerId int32) {
  124. builder.PrependInt32Slot(0, producerId, 0)
  125. }
  126. func MessageAddSegmentId(builder *flatbuffers.Builder, segmentId int32) {
  127. builder.PrependInt32Slot(1, segmentId, 0)
  128. }
  129. func MessageAddProducerSeq(builder *flatbuffers.Builder, producerSeq int64) {
  130. builder.PrependInt64Slot(2, producerSeq, 0)
  131. }
  132. func MessageAddSegmentSeq(builder *flatbuffers.Builder, segmentSeq int64) {
  133. builder.PrependInt64Slot(3, segmentSeq, 0)
  134. }
  135. func MessageAddEventTsNs(builder *flatbuffers.Builder, eventTsNs int64) {
  136. builder.PrependInt64Slot(4, eventTsNs, 0)
  137. }
  138. func MessageAddRecvTsNs(builder *flatbuffers.Builder, recvTsNs int64) {
  139. builder.PrependInt64Slot(5, recvTsNs, 0)
  140. }
  141. func MessageAddProperties(builder *flatbuffers.Builder, properties flatbuffers.UOffsetT) {
  142. builder.PrependUOffsetTSlot(6, flatbuffers.UOffsetT(properties), 0)
  143. }
  144. func MessageStartPropertiesVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT {
  145. return builder.StartVector(4, numElems, 4)
  146. }
  147. func MessageAddKey(builder *flatbuffers.Builder, key flatbuffers.UOffsetT) {
  148. builder.PrependUOffsetTSlot(7, flatbuffers.UOffsetT(key), 0)
  149. }
  150. func MessageAddData(builder *flatbuffers.Builder, data flatbuffers.UOffsetT) {
  151. builder.PrependUOffsetTSlot(8, flatbuffers.UOffsetT(data), 0)
  152. }
  153. func MessageEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
  154. return builder.EndObject()
  155. }