MessageBatch.go 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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 MessageBatch struct {
  7. _tab flatbuffers.Table
  8. }
  9. func GetRootAsMessageBatch(buf []byte, offset flatbuffers.UOffsetT) *MessageBatch {
  10. n := flatbuffers.GetUOffsetT(buf[offset:])
  11. x := &MessageBatch{}
  12. x.Init(buf, n+offset)
  13. return x
  14. }
  15. func GetSizePrefixedRootAsMessageBatch(buf []byte, offset flatbuffers.UOffsetT) *MessageBatch {
  16. n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:])
  17. x := &MessageBatch{}
  18. x.Init(buf, n+offset+flatbuffers.SizeUint32)
  19. return x
  20. }
  21. func (rcv *MessageBatch) Init(buf []byte, i flatbuffers.UOffsetT) {
  22. rcv._tab.Bytes = buf
  23. rcv._tab.Pos = i
  24. }
  25. func (rcv *MessageBatch) Table() flatbuffers.Table {
  26. return rcv._tab
  27. }
  28. func (rcv *MessageBatch) 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 *MessageBatch) MutateProducerId(n int32) bool {
  36. return rcv._tab.MutateInt32Slot(4, n)
  37. }
  38. func (rcv *MessageBatch) ProducerEpoch() 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 *MessageBatch) MutateProducerEpoch(n int32) bool {
  46. return rcv._tab.MutateInt32Slot(6, n)
  47. }
  48. func (rcv *MessageBatch) SegmentId() int32 {
  49. o := flatbuffers.UOffsetT(rcv._tab.Offset(8))
  50. if o != 0 {
  51. return rcv._tab.GetInt32(o + rcv._tab.Pos)
  52. }
  53. return 0
  54. }
  55. func (rcv *MessageBatch) MutateSegmentId(n int32) bool {
  56. return rcv._tab.MutateInt32Slot(8, n)
  57. }
  58. func (rcv *MessageBatch) Flags() int32 {
  59. o := flatbuffers.UOffsetT(rcv._tab.Offset(10))
  60. if o != 0 {
  61. return rcv._tab.GetInt32(o + rcv._tab.Pos)
  62. }
  63. return 0
  64. }
  65. func (rcv *MessageBatch) MutateFlags(n int32) bool {
  66. return rcv._tab.MutateInt32Slot(10, n)
  67. }
  68. func (rcv *MessageBatch) SegmentSeqBase() 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 *MessageBatch) MutateSegmentSeqBase(n int64) bool {
  76. return rcv._tab.MutateInt64Slot(12, n)
  77. }
  78. func (rcv *MessageBatch) SegmentSeqMaxDelta() int32 {
  79. o := flatbuffers.UOffsetT(rcv._tab.Offset(14))
  80. if o != 0 {
  81. return rcv._tab.GetInt32(o + rcv._tab.Pos)
  82. }
  83. return 0
  84. }
  85. func (rcv *MessageBatch) MutateSegmentSeqMaxDelta(n int32) bool {
  86. return rcv._tab.MutateInt32Slot(14, n)
  87. }
  88. func (rcv *MessageBatch) TsMsBase() int64 {
  89. o := flatbuffers.UOffsetT(rcv._tab.Offset(16))
  90. if o != 0 {
  91. return rcv._tab.GetInt64(o + rcv._tab.Pos)
  92. }
  93. return 0
  94. }
  95. func (rcv *MessageBatch) MutateTsMsBase(n int64) bool {
  96. return rcv._tab.MutateInt64Slot(16, n)
  97. }
  98. func (rcv *MessageBatch) TsMsMaxDelta() int32 {
  99. o := flatbuffers.UOffsetT(rcv._tab.Offset(18))
  100. if o != 0 {
  101. return rcv._tab.GetInt32(o + rcv._tab.Pos)
  102. }
  103. return 0
  104. }
  105. func (rcv *MessageBatch) MutateTsMsMaxDelta(n int32) bool {
  106. return rcv._tab.MutateInt32Slot(18, n)
  107. }
  108. func (rcv *MessageBatch) Messages(obj *Message, j int) bool {
  109. o := flatbuffers.UOffsetT(rcv._tab.Offset(20))
  110. if o != 0 {
  111. x := rcv._tab.Vector(o)
  112. x += flatbuffers.UOffsetT(j) * 4
  113. x = rcv._tab.Indirect(x)
  114. obj.Init(rcv._tab.Bytes, x)
  115. return true
  116. }
  117. return false
  118. }
  119. func (rcv *MessageBatch) MessagesLength() int {
  120. o := flatbuffers.UOffsetT(rcv._tab.Offset(20))
  121. if o != 0 {
  122. return rcv._tab.VectorLen(o)
  123. }
  124. return 0
  125. }
  126. func MessageBatchStart(builder *flatbuffers.Builder) {
  127. builder.StartObject(9)
  128. }
  129. func MessageBatchAddProducerId(builder *flatbuffers.Builder, producerId int32) {
  130. builder.PrependInt32Slot(0, producerId, 0)
  131. }
  132. func MessageBatchAddProducerEpoch(builder *flatbuffers.Builder, producerEpoch int32) {
  133. builder.PrependInt32Slot(1, producerEpoch, 0)
  134. }
  135. func MessageBatchAddSegmentId(builder *flatbuffers.Builder, segmentId int32) {
  136. builder.PrependInt32Slot(2, segmentId, 0)
  137. }
  138. func MessageBatchAddFlags(builder *flatbuffers.Builder, flags int32) {
  139. builder.PrependInt32Slot(3, flags, 0)
  140. }
  141. func MessageBatchAddSegmentSeqBase(builder *flatbuffers.Builder, segmentSeqBase int64) {
  142. builder.PrependInt64Slot(4, segmentSeqBase, 0)
  143. }
  144. func MessageBatchAddSegmentSeqMaxDelta(builder *flatbuffers.Builder, segmentSeqMaxDelta int32) {
  145. builder.PrependInt32Slot(5, segmentSeqMaxDelta, 0)
  146. }
  147. func MessageBatchAddTsMsBase(builder *flatbuffers.Builder, tsMsBase int64) {
  148. builder.PrependInt64Slot(6, tsMsBase, 0)
  149. }
  150. func MessageBatchAddTsMsMaxDelta(builder *flatbuffers.Builder, tsMsMaxDelta int32) {
  151. builder.PrependInt32Slot(7, tsMsMaxDelta, 0)
  152. }
  153. func MessageBatchAddMessages(builder *flatbuffers.Builder, messages flatbuffers.UOffsetT) {
  154. builder.PrependUOffsetTSlot(8, flatbuffers.UOffsetT(messages), 0)
  155. }
  156. func MessageBatchStartMessagesVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT {
  157. return builder.StartVector(4, numElems, 4)
  158. }
  159. func MessageBatchEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
  160. return builder.EndObject()
  161. }