github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/col/colserde/arrowserde/schema_generated.go (about) 1 // Code generated by the FlatBuffers compiler. DO NOT EDIT. 2 3 package arrowserde 4 5 import flatbuffers "github.com/google/flatbuffers/go" 6 7 type MetadataVersion = int16 8 9 const ( 10 /// 0.1.0 11 MetadataVersionV1 MetadataVersion = 0 12 /// 0.2.0 13 MetadataVersionV2 MetadataVersion = 1 14 /// 0.3.0 -> 0.7.1 15 MetadataVersionV3 MetadataVersion = 2 16 /// >= 0.8.0 17 MetadataVersionV4 MetadataVersion = 3 18 ) 19 20 var EnumNamesMetadataVersion = map[MetadataVersion]string{ 21 MetadataVersionV1: "V1", 22 MetadataVersionV2: "V2", 23 MetadataVersionV3: "V3", 24 MetadataVersionV4: "V4", 25 } 26 27 type UnionMode = int16 28 29 const ( 30 UnionModeSparse UnionMode = 0 31 UnionModeDense UnionMode = 1 32 ) 33 34 var EnumNamesUnionMode = map[UnionMode]string{ 35 UnionModeSparse: "Sparse", 36 UnionModeDense: "Dense", 37 } 38 39 type Precision = int16 40 41 const ( 42 PrecisionHALF Precision = 0 43 PrecisionSINGLE Precision = 1 44 PrecisionDOUBLE Precision = 2 45 ) 46 47 var EnumNamesPrecision = map[Precision]string{ 48 PrecisionHALF: "HALF", 49 PrecisionSINGLE: "SINGLE", 50 PrecisionDOUBLE: "DOUBLE", 51 } 52 53 type DateUnit = int16 54 55 const ( 56 DateUnitDAY DateUnit = 0 57 DateUnitMILLISECOND DateUnit = 1 58 ) 59 60 var EnumNamesDateUnit = map[DateUnit]string{ 61 DateUnitDAY: "DAY", 62 DateUnitMILLISECOND: "MILLISECOND", 63 } 64 65 type TimeUnit = int16 66 67 const ( 68 TimeUnitSECOND TimeUnit = 0 69 TimeUnitMILLISECOND TimeUnit = 1 70 TimeUnitMICROSECOND TimeUnit = 2 71 TimeUnitNANOSECOND TimeUnit = 3 72 ) 73 74 var EnumNamesTimeUnit = map[TimeUnit]string{ 75 TimeUnitSECOND: "SECOND", 76 TimeUnitMILLISECOND: "MILLISECOND", 77 TimeUnitMICROSECOND: "MICROSECOND", 78 TimeUnitNANOSECOND: "NANOSECOND", 79 } 80 81 type IntervalUnit = int16 82 83 const ( 84 IntervalUnitYEAR_MONTH IntervalUnit = 0 85 IntervalUnitDAY_TIME IntervalUnit = 1 86 ) 87 88 var EnumNamesIntervalUnit = map[IntervalUnit]string{ 89 IntervalUnitYEAR_MONTH: "YEAR_MONTH", 90 IntervalUnitDAY_TIME: "DAY_TIME", 91 } 92 93 /// ---------------------------------------------------------------------- 94 /// Top-level Type value, enabling extensible type-specific metadata. We can 95 /// add new logical types to Type without breaking backwards compatibility 96 type Type = byte 97 98 const ( 99 TypeNONE Type = 0 100 TypeNull Type = 1 101 TypeInt Type = 2 102 TypeFloatingPoint Type = 3 103 TypeBinary Type = 4 104 TypeUtf8 Type = 5 105 TypeBool Type = 6 106 TypeDecimal Type = 7 107 TypeDate Type = 8 108 TypeTime Type = 9 109 TypeTimestamp Type = 10 110 TypeInterval Type = 11 111 TypeList Type = 12 112 TypeStruct_ Type = 13 113 TypeUnion Type = 14 114 TypeFixedSizeBinary Type = 15 115 TypeFixedSizeList Type = 16 116 TypeMap Type = 17 117 ) 118 119 var EnumNamesType = map[Type]string{ 120 TypeNONE: "NONE", 121 TypeNull: "Null", 122 TypeInt: "Int", 123 TypeFloatingPoint: "FloatingPoint", 124 TypeBinary: "Binary", 125 TypeUtf8: "Utf8", 126 TypeBool: "Bool", 127 TypeDecimal: "Decimal", 128 TypeDate: "Date", 129 TypeTime: "Time", 130 TypeTimestamp: "Timestamp", 131 TypeInterval: "Interval", 132 TypeList: "List", 133 TypeStruct_: "Struct_", 134 TypeUnion: "Union", 135 TypeFixedSizeBinary: "FixedSizeBinary", 136 TypeFixedSizeList: "FixedSizeList", 137 TypeMap: "Map", 138 } 139 140 /// ---------------------------------------------------------------------- 141 /// Endianness of the platform producing the data 142 type Endianness = int16 143 144 const ( 145 EndiannessLittle Endianness = 0 146 EndiannessBig Endianness = 1 147 ) 148 149 var EnumNamesEndianness = map[Endianness]string{ 150 EndiannessLittle: "Little", 151 EndiannessBig: "Big", 152 } 153 154 /// These are stored in the flatbuffer in the Type union below 155 type Null struct { 156 _tab flatbuffers.Table 157 } 158 159 func GetRootAsNull(buf []byte, offset flatbuffers.UOffsetT) *Null { 160 n := flatbuffers.GetUOffsetT(buf[offset:]) 161 x := &Null{} 162 x.Init(buf, n+offset) 163 return x 164 } 165 166 func (rcv *Null) Init(buf []byte, i flatbuffers.UOffsetT) { 167 rcv._tab.Bytes = buf 168 rcv._tab.Pos = i 169 } 170 171 func (rcv *Null) Table() flatbuffers.Table { 172 return rcv._tab 173 } 174 175 func NullStart(builder *flatbuffers.Builder) { 176 builder.StartObject(0) 177 } 178 func NullEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { 179 return builder.EndObject() 180 } 181 182 /// A Struct_ in the flatbuffer metadata is the same as an Arrow Struct 183 /// (according to the physical memory layout). We used Struct_ here as 184 /// Struct is a reserved word in Flatbuffers 185 type Struct_ struct { 186 _tab flatbuffers.Table 187 } 188 189 func GetRootAsStruct_(buf []byte, offset flatbuffers.UOffsetT) *Struct_ { 190 n := flatbuffers.GetUOffsetT(buf[offset:]) 191 x := &Struct_{} 192 x.Init(buf, n+offset) 193 return x 194 } 195 196 func (rcv *Struct_) Init(buf []byte, i flatbuffers.UOffsetT) { 197 rcv._tab.Bytes = buf 198 rcv._tab.Pos = i 199 } 200 201 func (rcv *Struct_) Table() flatbuffers.Table { 202 return rcv._tab 203 } 204 205 func Struct_Start(builder *flatbuffers.Builder) { 206 builder.StartObject(0) 207 } 208 func Struct_End(builder *flatbuffers.Builder) flatbuffers.UOffsetT { 209 return builder.EndObject() 210 } 211 212 type List struct { 213 _tab flatbuffers.Table 214 } 215 216 func GetRootAsList(buf []byte, offset flatbuffers.UOffsetT) *List { 217 n := flatbuffers.GetUOffsetT(buf[offset:]) 218 x := &List{} 219 x.Init(buf, n+offset) 220 return x 221 } 222 223 func (rcv *List) Init(buf []byte, i flatbuffers.UOffsetT) { 224 rcv._tab.Bytes = buf 225 rcv._tab.Pos = i 226 } 227 228 func (rcv *List) Table() flatbuffers.Table { 229 return rcv._tab 230 } 231 232 func ListStart(builder *flatbuffers.Builder) { 233 builder.StartObject(0) 234 } 235 func ListEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { 236 return builder.EndObject() 237 } 238 239 type FixedSizeList struct { 240 _tab flatbuffers.Table 241 } 242 243 func GetRootAsFixedSizeList(buf []byte, offset flatbuffers.UOffsetT) *FixedSizeList { 244 n := flatbuffers.GetUOffsetT(buf[offset:]) 245 x := &FixedSizeList{} 246 x.Init(buf, n+offset) 247 return x 248 } 249 250 func (rcv *FixedSizeList) Init(buf []byte, i flatbuffers.UOffsetT) { 251 rcv._tab.Bytes = buf 252 rcv._tab.Pos = i 253 } 254 255 func (rcv *FixedSizeList) Table() flatbuffers.Table { 256 return rcv._tab 257 } 258 259 /// Number of list items per value 260 func (rcv *FixedSizeList) ListSize() int32 { 261 o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) 262 if o != 0 { 263 return rcv._tab.GetInt32(o + rcv._tab.Pos) 264 } 265 return 0 266 } 267 268 /// Number of list items per value 269 func (rcv *FixedSizeList) MutateListSize(n int32) bool { 270 return rcv._tab.MutateInt32Slot(4, n) 271 } 272 273 func FixedSizeListStart(builder *flatbuffers.Builder) { 274 builder.StartObject(1) 275 } 276 func FixedSizeListAddListSize(builder *flatbuffers.Builder, listSize int32) { 277 builder.PrependInt32Slot(0, listSize, 0) 278 } 279 func FixedSizeListEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { 280 return builder.EndObject() 281 } 282 283 /// A Map is a logical nested type that is represented as 284 /// 285 /// List<entry: Struct<key: K, value: V>> 286 /// 287 /// In this layout, the keys and values are each respectively contiguous. We do 288 /// not constrain the key and value types, so the application is responsible 289 /// for ensuring that the keys are hashable and unique. Whether the keys are sorted 290 /// may be set in the metadata for this field 291 /// 292 /// In a Field with Map type, the Field has a child Struct field, which then 293 /// has two children: key type and the second the value type. The names of the 294 /// child fields may be respectively "entry", "key", and "value", but this is 295 /// not enforced 296 /// 297 /// Map 298 /// - child[0] entry: Struct 299 /// - child[0] key: K 300 /// - child[1] value: V 301 /// 302 /// Neither the "entry" field nor the "key" field may be nullable. 303 /// 304 /// The metadata is structured so that Arrow systems without special handling 305 /// for Map can make Map an alias for List. The "layout" attribute for the Map 306 /// field must have the same contents as a List. 307 type Map struct { 308 _tab flatbuffers.Table 309 } 310 311 func GetRootAsMap(buf []byte, offset flatbuffers.UOffsetT) *Map { 312 n := flatbuffers.GetUOffsetT(buf[offset:]) 313 x := &Map{} 314 x.Init(buf, n+offset) 315 return x 316 } 317 318 func (rcv *Map) Init(buf []byte, i flatbuffers.UOffsetT) { 319 rcv._tab.Bytes = buf 320 rcv._tab.Pos = i 321 } 322 323 func (rcv *Map) Table() flatbuffers.Table { 324 return rcv._tab 325 } 326 327 /// Set to true if the keys within each value are sorted 328 func (rcv *Map) KeysSorted() byte { 329 o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) 330 if o != 0 { 331 return rcv._tab.GetByte(o + rcv._tab.Pos) 332 } 333 return 0 334 } 335 336 /// Set to true if the keys within each value are sorted 337 func (rcv *Map) MutateKeysSorted(n byte) bool { 338 return rcv._tab.MutateByteSlot(4, n) 339 } 340 341 func MapStart(builder *flatbuffers.Builder) { 342 builder.StartObject(1) 343 } 344 func MapAddKeysSorted(builder *flatbuffers.Builder, keysSorted byte) { 345 builder.PrependByteSlot(0, keysSorted, 0) 346 } 347 func MapEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { 348 return builder.EndObject() 349 } 350 351 /// A union is a complex type with children in Field 352 /// By default ids in the type vector refer to the offsets in the children 353 /// optionally typeIds provides an indirection between the child offset and the type id 354 /// for each child typeIds[offset] is the id used in the type vector 355 type Union struct { 356 _tab flatbuffers.Table 357 } 358 359 func GetRootAsUnion(buf []byte, offset flatbuffers.UOffsetT) *Union { 360 n := flatbuffers.GetUOffsetT(buf[offset:]) 361 x := &Union{} 362 x.Init(buf, n+offset) 363 return x 364 } 365 366 func (rcv *Union) Init(buf []byte, i flatbuffers.UOffsetT) { 367 rcv._tab.Bytes = buf 368 rcv._tab.Pos = i 369 } 370 371 func (rcv *Union) Table() flatbuffers.Table { 372 return rcv._tab 373 } 374 375 func (rcv *Union) Mode() int16 { 376 o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) 377 if o != 0 { 378 return rcv._tab.GetInt16(o + rcv._tab.Pos) 379 } 380 return 0 381 } 382 383 func (rcv *Union) MutateMode(n int16) bool { 384 return rcv._tab.MutateInt16Slot(4, n) 385 } 386 387 func (rcv *Union) TypeIds(j int) int32 { 388 o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) 389 if o != 0 { 390 a := rcv._tab.Vector(o) 391 return rcv._tab.GetInt32(a + flatbuffers.UOffsetT(j*4)) 392 } 393 return 0 394 } 395 396 func (rcv *Union) TypeIdsLength() int { 397 o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) 398 if o != 0 { 399 return rcv._tab.VectorLen(o) 400 } 401 return 0 402 } 403 404 func UnionStart(builder *flatbuffers.Builder) { 405 builder.StartObject(2) 406 } 407 func UnionAddMode(builder *flatbuffers.Builder, mode int16) { 408 builder.PrependInt16Slot(0, mode, 0) 409 } 410 func UnionAddTypeIds(builder *flatbuffers.Builder, typeIds flatbuffers.UOffsetT) { 411 builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(typeIds), 0) 412 } 413 func UnionStartTypeIdsVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { 414 return builder.StartVector(4, numElems, 4) 415 } 416 func UnionEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { 417 return builder.EndObject() 418 } 419 420 type Int struct { 421 _tab flatbuffers.Table 422 } 423 424 func GetRootAsInt(buf []byte, offset flatbuffers.UOffsetT) *Int { 425 n := flatbuffers.GetUOffsetT(buf[offset:]) 426 x := &Int{} 427 x.Init(buf, n+offset) 428 return x 429 } 430 431 func (rcv *Int) Init(buf []byte, i flatbuffers.UOffsetT) { 432 rcv._tab.Bytes = buf 433 rcv._tab.Pos = i 434 } 435 436 func (rcv *Int) Table() flatbuffers.Table { 437 return rcv._tab 438 } 439 440 func (rcv *Int) BitWidth() int32 { 441 o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) 442 if o != 0 { 443 return rcv._tab.GetInt32(o + rcv._tab.Pos) 444 } 445 return 0 446 } 447 448 func (rcv *Int) MutateBitWidth(n int32) bool { 449 return rcv._tab.MutateInt32Slot(4, n) 450 } 451 452 func (rcv *Int) IsSigned() byte { 453 o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) 454 if o != 0 { 455 return rcv._tab.GetByte(o + rcv._tab.Pos) 456 } 457 return 0 458 } 459 460 func (rcv *Int) MutateIsSigned(n byte) bool { 461 return rcv._tab.MutateByteSlot(6, n) 462 } 463 464 func IntStart(builder *flatbuffers.Builder) { 465 builder.StartObject(2) 466 } 467 func IntAddBitWidth(builder *flatbuffers.Builder, bitWidth int32) { 468 builder.PrependInt32Slot(0, bitWidth, 0) 469 } 470 func IntAddIsSigned(builder *flatbuffers.Builder, isSigned byte) { 471 builder.PrependByteSlot(1, isSigned, 0) 472 } 473 func IntEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { 474 return builder.EndObject() 475 } 476 477 type FloatingPoint struct { 478 _tab flatbuffers.Table 479 } 480 481 func GetRootAsFloatingPoint(buf []byte, offset flatbuffers.UOffsetT) *FloatingPoint { 482 n := flatbuffers.GetUOffsetT(buf[offset:]) 483 x := &FloatingPoint{} 484 x.Init(buf, n+offset) 485 return x 486 } 487 488 func (rcv *FloatingPoint) Init(buf []byte, i flatbuffers.UOffsetT) { 489 rcv._tab.Bytes = buf 490 rcv._tab.Pos = i 491 } 492 493 func (rcv *FloatingPoint) Table() flatbuffers.Table { 494 return rcv._tab 495 } 496 497 func (rcv *FloatingPoint) Precision() int16 { 498 o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) 499 if o != 0 { 500 return rcv._tab.GetInt16(o + rcv._tab.Pos) 501 } 502 return 0 503 } 504 505 func (rcv *FloatingPoint) MutatePrecision(n int16) bool { 506 return rcv._tab.MutateInt16Slot(4, n) 507 } 508 509 func FloatingPointStart(builder *flatbuffers.Builder) { 510 builder.StartObject(1) 511 } 512 func FloatingPointAddPrecision(builder *flatbuffers.Builder, precision int16) { 513 builder.PrependInt16Slot(0, precision, 0) 514 } 515 func FloatingPointEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { 516 return builder.EndObject() 517 } 518 519 /// Unicode with UTF-8 encoding 520 type Utf8 struct { 521 _tab flatbuffers.Table 522 } 523 524 func GetRootAsUtf8(buf []byte, offset flatbuffers.UOffsetT) *Utf8 { 525 n := flatbuffers.GetUOffsetT(buf[offset:]) 526 x := &Utf8{} 527 x.Init(buf, n+offset) 528 return x 529 } 530 531 func (rcv *Utf8) Init(buf []byte, i flatbuffers.UOffsetT) { 532 rcv._tab.Bytes = buf 533 rcv._tab.Pos = i 534 } 535 536 func (rcv *Utf8) Table() flatbuffers.Table { 537 return rcv._tab 538 } 539 540 func Utf8Start(builder *flatbuffers.Builder) { 541 builder.StartObject(0) 542 } 543 func Utf8End(builder *flatbuffers.Builder) flatbuffers.UOffsetT { 544 return builder.EndObject() 545 } 546 547 type Binary struct { 548 _tab flatbuffers.Table 549 } 550 551 func GetRootAsBinary(buf []byte, offset flatbuffers.UOffsetT) *Binary { 552 n := flatbuffers.GetUOffsetT(buf[offset:]) 553 x := &Binary{} 554 x.Init(buf, n+offset) 555 return x 556 } 557 558 func (rcv *Binary) Init(buf []byte, i flatbuffers.UOffsetT) { 559 rcv._tab.Bytes = buf 560 rcv._tab.Pos = i 561 } 562 563 func (rcv *Binary) Table() flatbuffers.Table { 564 return rcv._tab 565 } 566 567 func BinaryStart(builder *flatbuffers.Builder) { 568 builder.StartObject(0) 569 } 570 func BinaryEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { 571 return builder.EndObject() 572 } 573 574 type FixedSizeBinary struct { 575 _tab flatbuffers.Table 576 } 577 578 func GetRootAsFixedSizeBinary(buf []byte, offset flatbuffers.UOffsetT) *FixedSizeBinary { 579 n := flatbuffers.GetUOffsetT(buf[offset:]) 580 x := &FixedSizeBinary{} 581 x.Init(buf, n+offset) 582 return x 583 } 584 585 func (rcv *FixedSizeBinary) Init(buf []byte, i flatbuffers.UOffsetT) { 586 rcv._tab.Bytes = buf 587 rcv._tab.Pos = i 588 } 589 590 func (rcv *FixedSizeBinary) Table() flatbuffers.Table { 591 return rcv._tab 592 } 593 594 /// Number of bytes per value 595 func (rcv *FixedSizeBinary) ByteWidth() int32 { 596 o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) 597 if o != 0 { 598 return rcv._tab.GetInt32(o + rcv._tab.Pos) 599 } 600 return 0 601 } 602 603 /// Number of bytes per value 604 func (rcv *FixedSizeBinary) MutateByteWidth(n int32) bool { 605 return rcv._tab.MutateInt32Slot(4, n) 606 } 607 608 func FixedSizeBinaryStart(builder *flatbuffers.Builder) { 609 builder.StartObject(1) 610 } 611 func FixedSizeBinaryAddByteWidth(builder *flatbuffers.Builder, byteWidth int32) { 612 builder.PrependInt32Slot(0, byteWidth, 0) 613 } 614 func FixedSizeBinaryEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { 615 return builder.EndObject() 616 } 617 618 type Bool struct { 619 _tab flatbuffers.Table 620 } 621 622 func GetRootAsBool(buf []byte, offset flatbuffers.UOffsetT) *Bool { 623 n := flatbuffers.GetUOffsetT(buf[offset:]) 624 x := &Bool{} 625 x.Init(buf, n+offset) 626 return x 627 } 628 629 func (rcv *Bool) Init(buf []byte, i flatbuffers.UOffsetT) { 630 rcv._tab.Bytes = buf 631 rcv._tab.Pos = i 632 } 633 634 func (rcv *Bool) Table() flatbuffers.Table { 635 return rcv._tab 636 } 637 638 func BoolStart(builder *flatbuffers.Builder) { 639 builder.StartObject(0) 640 } 641 func BoolEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { 642 return builder.EndObject() 643 } 644 645 type Decimal struct { 646 _tab flatbuffers.Table 647 } 648 649 func GetRootAsDecimal(buf []byte, offset flatbuffers.UOffsetT) *Decimal { 650 n := flatbuffers.GetUOffsetT(buf[offset:]) 651 x := &Decimal{} 652 x.Init(buf, n+offset) 653 return x 654 } 655 656 func (rcv *Decimal) Init(buf []byte, i flatbuffers.UOffsetT) { 657 rcv._tab.Bytes = buf 658 rcv._tab.Pos = i 659 } 660 661 func (rcv *Decimal) Table() flatbuffers.Table { 662 return rcv._tab 663 } 664 665 /// Total number of decimal digits 666 func (rcv *Decimal) Precision() int32 { 667 o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) 668 if o != 0 { 669 return rcv._tab.GetInt32(o + rcv._tab.Pos) 670 } 671 return 0 672 } 673 674 /// Total number of decimal digits 675 func (rcv *Decimal) MutatePrecision(n int32) bool { 676 return rcv._tab.MutateInt32Slot(4, n) 677 } 678 679 /// Number of digits after the decimal point "." 680 func (rcv *Decimal) Scale() int32 { 681 o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) 682 if o != 0 { 683 return rcv._tab.GetInt32(o + rcv._tab.Pos) 684 } 685 return 0 686 } 687 688 /// Number of digits after the decimal point "." 689 func (rcv *Decimal) MutateScale(n int32) bool { 690 return rcv._tab.MutateInt32Slot(6, n) 691 } 692 693 func DecimalStart(builder *flatbuffers.Builder) { 694 builder.StartObject(2) 695 } 696 func DecimalAddPrecision(builder *flatbuffers.Builder, precision int32) { 697 builder.PrependInt32Slot(0, precision, 0) 698 } 699 func DecimalAddScale(builder *flatbuffers.Builder, scale int32) { 700 builder.PrependInt32Slot(1, scale, 0) 701 } 702 func DecimalEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { 703 return builder.EndObject() 704 } 705 706 /// Date is either a 32-bit or 64-bit type representing elapsed time since UNIX 707 /// epoch (1970-01-01), stored in either of two units: 708 /// 709 /// * Milliseconds (64 bits) indicating UNIX time elapsed since the epoch (no 710 /// leap seconds), where the values are evenly divisible by 86400000 711 /// * Days (32 bits) since the UNIX epoch 712 type Date struct { 713 _tab flatbuffers.Table 714 } 715 716 func GetRootAsDate(buf []byte, offset flatbuffers.UOffsetT) *Date { 717 n := flatbuffers.GetUOffsetT(buf[offset:]) 718 x := &Date{} 719 x.Init(buf, n+offset) 720 return x 721 } 722 723 func (rcv *Date) Init(buf []byte, i flatbuffers.UOffsetT) { 724 rcv._tab.Bytes = buf 725 rcv._tab.Pos = i 726 } 727 728 func (rcv *Date) Table() flatbuffers.Table { 729 return rcv._tab 730 } 731 732 func (rcv *Date) Unit() int16 { 733 o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) 734 if o != 0 { 735 return rcv._tab.GetInt16(o + rcv._tab.Pos) 736 } 737 return 1 738 } 739 740 func (rcv *Date) MutateUnit(n int16) bool { 741 return rcv._tab.MutateInt16Slot(4, n) 742 } 743 744 func DateStart(builder *flatbuffers.Builder) { 745 builder.StartObject(1) 746 } 747 func DateAddUnit(builder *flatbuffers.Builder, unit int16) { 748 builder.PrependInt16Slot(0, unit, 1) 749 } 750 func DateEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { 751 return builder.EndObject() 752 } 753 754 /// Time type. The physical storage type depends on the unit 755 /// - SECOND and MILLISECOND: 32 bits 756 /// - MICROSECOND and NANOSECOND: 64 bits 757 type Time struct { 758 _tab flatbuffers.Table 759 } 760 761 func GetRootAsTime(buf []byte, offset flatbuffers.UOffsetT) *Time { 762 n := flatbuffers.GetUOffsetT(buf[offset:]) 763 x := &Time{} 764 x.Init(buf, n+offset) 765 return x 766 } 767 768 func (rcv *Time) Init(buf []byte, i flatbuffers.UOffsetT) { 769 rcv._tab.Bytes = buf 770 rcv._tab.Pos = i 771 } 772 773 func (rcv *Time) Table() flatbuffers.Table { 774 return rcv._tab 775 } 776 777 func (rcv *Time) Unit() int16 { 778 o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) 779 if o != 0 { 780 return rcv._tab.GetInt16(o + rcv._tab.Pos) 781 } 782 return 1 783 } 784 785 func (rcv *Time) MutateUnit(n int16) bool { 786 return rcv._tab.MutateInt16Slot(4, n) 787 } 788 789 func (rcv *Time) BitWidth() int32 { 790 o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) 791 if o != 0 { 792 return rcv._tab.GetInt32(o + rcv._tab.Pos) 793 } 794 return 32 795 } 796 797 func (rcv *Time) MutateBitWidth(n int32) bool { 798 return rcv._tab.MutateInt32Slot(6, n) 799 } 800 801 func TimeStart(builder *flatbuffers.Builder) { 802 builder.StartObject(2) 803 } 804 func TimeAddUnit(builder *flatbuffers.Builder, unit int16) { 805 builder.PrependInt16Slot(0, unit, 1) 806 } 807 func TimeAddBitWidth(builder *flatbuffers.Builder, bitWidth int32) { 808 builder.PrependInt32Slot(1, bitWidth, 32) 809 } 810 func TimeEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { 811 return builder.EndObject() 812 } 813 814 /// Time elapsed from the Unix epoch, 00:00:00.000 on 1 January 1970, excluding 815 /// leap seconds, as a 64-bit integer. Note that UNIX time does not include 816 /// leap seconds. 817 /// 818 /// The Timestamp metadata supports both "time zone naive" and "time zone 819 /// aware" timestamps. Read about the timezone attribute for more detail 820 type Timestamp struct { 821 _tab flatbuffers.Table 822 } 823 824 func GetRootAsTimestamp(buf []byte, offset flatbuffers.UOffsetT) *Timestamp { 825 n := flatbuffers.GetUOffsetT(buf[offset:]) 826 x := &Timestamp{} 827 x.Init(buf, n+offset) 828 return x 829 } 830 831 func (rcv *Timestamp) Init(buf []byte, i flatbuffers.UOffsetT) { 832 rcv._tab.Bytes = buf 833 rcv._tab.Pos = i 834 } 835 836 func (rcv *Timestamp) Table() flatbuffers.Table { 837 return rcv._tab 838 } 839 840 func (rcv *Timestamp) Unit() int16 { 841 o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) 842 if o != 0 { 843 return rcv._tab.GetInt16(o + rcv._tab.Pos) 844 } 845 return 0 846 } 847 848 func (rcv *Timestamp) MutateUnit(n int16) bool { 849 return rcv._tab.MutateInt16Slot(4, n) 850 } 851 852 /// The time zone is a string indicating the name of a time zone, one of: 853 /// 854 /// * As used in the Olson time zone database (the "tz database" or 855 /// "tzdata"), such as "America/New_York" 856 /// * An absolute time zone offset of the form +XX:XX or -XX:XX, such as +07:30 857 /// 858 /// Whether a timezone string is present indicates different semantics about 859 /// the data: 860 /// 861 /// * If the time zone is null or equal to an empty string, the data is "time 862 /// zone naive" and shall be displayed *as is* to the user, not localized 863 /// to the locale of the user. This data can be though of as UTC but 864 /// without having "UTC" as the time zone, it is not considered to be 865 /// localized to any time zone 866 /// 867 /// * If the time zone is set to a valid value, values can be displayed as 868 /// "localized" to that time zone, even though the underlying 64-bit 869 /// integers are identical to the same data stored in UTC. Converting 870 /// between time zones is a metadata-only operation and does not change the 871 /// underlying values 872 func (rcv *Timestamp) Timezone() []byte { 873 o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) 874 if o != 0 { 875 return rcv._tab.ByteVector(o + rcv._tab.Pos) 876 } 877 return nil 878 } 879 880 /// The time zone is a string indicating the name of a time zone, one of: 881 /// 882 /// * As used in the Olson time zone database (the "tz database" or 883 /// "tzdata"), such as "America/New_York" 884 /// * An absolute time zone offset of the form +XX:XX or -XX:XX, such as +07:30 885 /// 886 /// Whether a timezone string is present indicates different semantics about 887 /// the data: 888 /// 889 /// * If the time zone is null or equal to an empty string, the data is "time 890 /// zone naive" and shall be displayed *as is* to the user, not localized 891 /// to the locale of the user. This data can be though of as UTC but 892 /// without having "UTC" as the time zone, it is not considered to be 893 /// localized to any time zone 894 /// 895 /// * If the time zone is set to a valid value, values can be displayed as 896 /// "localized" to that time zone, even though the underlying 64-bit 897 /// integers are identical to the same data stored in UTC. Converting 898 /// between time zones is a metadata-only operation and does not change the 899 /// underlying values 900 func TimestampStart(builder *flatbuffers.Builder) { 901 builder.StartObject(2) 902 } 903 func TimestampAddUnit(builder *flatbuffers.Builder, unit int16) { 904 builder.PrependInt16Slot(0, unit, 0) 905 } 906 func TimestampAddTimezone(builder *flatbuffers.Builder, timezone flatbuffers.UOffsetT) { 907 builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(timezone), 0) 908 } 909 func TimestampEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { 910 return builder.EndObject() 911 } 912 913 type Interval struct { 914 _tab flatbuffers.Table 915 } 916 917 func GetRootAsInterval(buf []byte, offset flatbuffers.UOffsetT) *Interval { 918 n := flatbuffers.GetUOffsetT(buf[offset:]) 919 x := &Interval{} 920 x.Init(buf, n+offset) 921 return x 922 } 923 924 func (rcv *Interval) Init(buf []byte, i flatbuffers.UOffsetT) { 925 rcv._tab.Bytes = buf 926 rcv._tab.Pos = i 927 } 928 929 func (rcv *Interval) Table() flatbuffers.Table { 930 return rcv._tab 931 } 932 933 func (rcv *Interval) Unit() int16 { 934 o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) 935 if o != 0 { 936 return rcv._tab.GetInt16(o + rcv._tab.Pos) 937 } 938 return 0 939 } 940 941 func (rcv *Interval) MutateUnit(n int16) bool { 942 return rcv._tab.MutateInt16Slot(4, n) 943 } 944 945 func IntervalStart(builder *flatbuffers.Builder) { 946 builder.StartObject(1) 947 } 948 func IntervalAddUnit(builder *flatbuffers.Builder, unit int16) { 949 builder.PrependInt16Slot(0, unit, 0) 950 } 951 func IntervalEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { 952 return builder.EndObject() 953 } 954 955 /// ---------------------------------------------------------------------- 956 /// user defined key value pairs to add custom metadata to arrow 957 /// key namespacing is the responsibility of the user 958 type KeyValue struct { 959 _tab flatbuffers.Table 960 } 961 962 func GetRootAsKeyValue(buf []byte, offset flatbuffers.UOffsetT) *KeyValue { 963 n := flatbuffers.GetUOffsetT(buf[offset:]) 964 x := &KeyValue{} 965 x.Init(buf, n+offset) 966 return x 967 } 968 969 func (rcv *KeyValue) Init(buf []byte, i flatbuffers.UOffsetT) { 970 rcv._tab.Bytes = buf 971 rcv._tab.Pos = i 972 } 973 974 func (rcv *KeyValue) Table() flatbuffers.Table { 975 return rcv._tab 976 } 977 978 func (rcv *KeyValue) Key() []byte { 979 o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) 980 if o != 0 { 981 return rcv._tab.ByteVector(o + rcv._tab.Pos) 982 } 983 return nil 984 } 985 986 func (rcv *KeyValue) Value() []byte { 987 o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) 988 if o != 0 { 989 return rcv._tab.ByteVector(o + rcv._tab.Pos) 990 } 991 return nil 992 } 993 994 func KeyValueStart(builder *flatbuffers.Builder) { 995 builder.StartObject(2) 996 } 997 func KeyValueAddKey(builder *flatbuffers.Builder, key flatbuffers.UOffsetT) { 998 builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(key), 0) 999 } 1000 func KeyValueAddValue(builder *flatbuffers.Builder, value flatbuffers.UOffsetT) { 1001 builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(value), 0) 1002 } 1003 func KeyValueEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { 1004 return builder.EndObject() 1005 } 1006 1007 /// ---------------------------------------------------------------------- 1008 /// Dictionary encoding metadata 1009 type DictionaryEncoding struct { 1010 _tab flatbuffers.Table 1011 } 1012 1013 func GetRootAsDictionaryEncoding(buf []byte, offset flatbuffers.UOffsetT) *DictionaryEncoding { 1014 n := flatbuffers.GetUOffsetT(buf[offset:]) 1015 x := &DictionaryEncoding{} 1016 x.Init(buf, n+offset) 1017 return x 1018 } 1019 1020 func (rcv *DictionaryEncoding) Init(buf []byte, i flatbuffers.UOffsetT) { 1021 rcv._tab.Bytes = buf 1022 rcv._tab.Pos = i 1023 } 1024 1025 func (rcv *DictionaryEncoding) Table() flatbuffers.Table { 1026 return rcv._tab 1027 } 1028 1029 /// The known dictionary id in the application where this data is used. In 1030 /// the file or streaming formats, the dictionary ids are found in the 1031 /// DictionaryBatch messages 1032 func (rcv *DictionaryEncoding) Id() int64 { 1033 o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) 1034 if o != 0 { 1035 return rcv._tab.GetInt64(o + rcv._tab.Pos) 1036 } 1037 return 0 1038 } 1039 1040 /// The known dictionary id in the application where this data is used. In 1041 /// the file or streaming formats, the dictionary ids are found in the 1042 /// DictionaryBatch messages 1043 func (rcv *DictionaryEncoding) MutateId(n int64) bool { 1044 return rcv._tab.MutateInt64Slot(4, n) 1045 } 1046 1047 /// The dictionary indices are constrained to be positive integers. If this 1048 /// field is null, the indices must be signed int32 1049 func (rcv *DictionaryEncoding) IndexType(obj *Int) *Int { 1050 o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) 1051 if o != 0 { 1052 x := rcv._tab.Indirect(o + rcv._tab.Pos) 1053 if obj == nil { 1054 obj = new(Int) 1055 } 1056 obj.Init(rcv._tab.Bytes, x) 1057 return obj 1058 } 1059 return nil 1060 } 1061 1062 /// The dictionary indices are constrained to be positive integers. If this 1063 /// field is null, the indices must be signed int32 1064 /// By default, dictionaries are not ordered, or the order does not have 1065 /// semantic meaning. In some statistical, applications, dictionary-encoding 1066 /// is used to represent ordered categorical data, and we provide a way to 1067 /// preserve that metadata here 1068 func (rcv *DictionaryEncoding) IsOrdered() byte { 1069 o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) 1070 if o != 0 { 1071 return rcv._tab.GetByte(o + rcv._tab.Pos) 1072 } 1073 return 0 1074 } 1075 1076 /// By default, dictionaries are not ordered, or the order does not have 1077 /// semantic meaning. In some statistical, applications, dictionary-encoding 1078 /// is used to represent ordered categorical data, and we provide a way to 1079 /// preserve that metadata here 1080 func (rcv *DictionaryEncoding) MutateIsOrdered(n byte) bool { 1081 return rcv._tab.MutateByteSlot(8, n) 1082 } 1083 1084 func DictionaryEncodingStart(builder *flatbuffers.Builder) { 1085 builder.StartObject(3) 1086 } 1087 func DictionaryEncodingAddId(builder *flatbuffers.Builder, id int64) { 1088 builder.PrependInt64Slot(0, id, 0) 1089 } 1090 func DictionaryEncodingAddIndexType(builder *flatbuffers.Builder, indexType flatbuffers.UOffsetT) { 1091 builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(indexType), 0) 1092 } 1093 func DictionaryEncodingAddIsOrdered(builder *flatbuffers.Builder, isOrdered byte) { 1094 builder.PrependByteSlot(2, isOrdered, 0) 1095 } 1096 func DictionaryEncodingEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { 1097 return builder.EndObject() 1098 } 1099 1100 /// ---------------------------------------------------------------------- 1101 /// A field represents a named column in a record / row batch or child of a 1102 /// nested type. 1103 /// 1104 /// - children is only for nested Arrow arrays 1105 /// - For primitive types, children will have length 0 1106 /// - nullable should default to true in general 1107 type Field struct { 1108 _tab flatbuffers.Table 1109 } 1110 1111 func GetRootAsField(buf []byte, offset flatbuffers.UOffsetT) *Field { 1112 n := flatbuffers.GetUOffsetT(buf[offset:]) 1113 x := &Field{} 1114 x.Init(buf, n+offset) 1115 return x 1116 } 1117 1118 func (rcv *Field) Init(buf []byte, i flatbuffers.UOffsetT) { 1119 rcv._tab.Bytes = buf 1120 rcv._tab.Pos = i 1121 } 1122 1123 func (rcv *Field) Table() flatbuffers.Table { 1124 return rcv._tab 1125 } 1126 1127 func (rcv *Field) Name() []byte { 1128 o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) 1129 if o != 0 { 1130 return rcv._tab.ByteVector(o + rcv._tab.Pos) 1131 } 1132 return nil 1133 } 1134 1135 func (rcv *Field) Nullable() byte { 1136 o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) 1137 if o != 0 { 1138 return rcv._tab.GetByte(o + rcv._tab.Pos) 1139 } 1140 return 0 1141 } 1142 1143 func (rcv *Field) MutateNullable(n byte) bool { 1144 return rcv._tab.MutateByteSlot(6, n) 1145 } 1146 1147 func (rcv *Field) TypeType() byte { 1148 o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) 1149 if o != 0 { 1150 return rcv._tab.GetByte(o + rcv._tab.Pos) 1151 } 1152 return 0 1153 } 1154 1155 func (rcv *Field) MutateTypeType(n byte) bool { 1156 return rcv._tab.MutateByteSlot(8, n) 1157 } 1158 1159 func (rcv *Field) Type(obj *flatbuffers.Table) bool { 1160 o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) 1161 if o != 0 { 1162 rcv._tab.Union(obj, o) 1163 return true 1164 } 1165 return false 1166 } 1167 1168 func (rcv *Field) Dictionary(obj *DictionaryEncoding) *DictionaryEncoding { 1169 o := flatbuffers.UOffsetT(rcv._tab.Offset(12)) 1170 if o != 0 { 1171 x := rcv._tab.Indirect(o + rcv._tab.Pos) 1172 if obj == nil { 1173 obj = new(DictionaryEncoding) 1174 } 1175 obj.Init(rcv._tab.Bytes, x) 1176 return obj 1177 } 1178 return nil 1179 } 1180 1181 func (rcv *Field) Children(obj *Field, j int) bool { 1182 o := flatbuffers.UOffsetT(rcv._tab.Offset(14)) 1183 if o != 0 { 1184 x := rcv._tab.Vector(o) 1185 x += flatbuffers.UOffsetT(j) * 4 1186 x = rcv._tab.Indirect(x) 1187 obj.Init(rcv._tab.Bytes, x) 1188 return true 1189 } 1190 return false 1191 } 1192 1193 func (rcv *Field) ChildrenLength() int { 1194 o := flatbuffers.UOffsetT(rcv._tab.Offset(14)) 1195 if o != 0 { 1196 return rcv._tab.VectorLen(o) 1197 } 1198 return 0 1199 } 1200 1201 func (rcv *Field) CustomMetadata(obj *KeyValue, j int) bool { 1202 o := flatbuffers.UOffsetT(rcv._tab.Offset(16)) 1203 if o != 0 { 1204 x := rcv._tab.Vector(o) 1205 x += flatbuffers.UOffsetT(j) * 4 1206 x = rcv._tab.Indirect(x) 1207 obj.Init(rcv._tab.Bytes, x) 1208 return true 1209 } 1210 return false 1211 } 1212 1213 func (rcv *Field) CustomMetadataLength() int { 1214 o := flatbuffers.UOffsetT(rcv._tab.Offset(16)) 1215 if o != 0 { 1216 return rcv._tab.VectorLen(o) 1217 } 1218 return 0 1219 } 1220 1221 func FieldStart(builder *flatbuffers.Builder) { 1222 builder.StartObject(7) 1223 } 1224 func FieldAddName(builder *flatbuffers.Builder, name flatbuffers.UOffsetT) { 1225 builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(name), 0) 1226 } 1227 func FieldAddNullable(builder *flatbuffers.Builder, nullable byte) { 1228 builder.PrependByteSlot(1, nullable, 0) 1229 } 1230 func FieldAddTypeType(builder *flatbuffers.Builder, typeType byte) { 1231 builder.PrependByteSlot(2, typeType, 0) 1232 } 1233 func FieldAddType(builder *flatbuffers.Builder, type_ flatbuffers.UOffsetT) { 1234 builder.PrependUOffsetTSlot(3, flatbuffers.UOffsetT(type_), 0) 1235 } 1236 func FieldAddDictionary(builder *flatbuffers.Builder, dictionary flatbuffers.UOffsetT) { 1237 builder.PrependUOffsetTSlot(4, flatbuffers.UOffsetT(dictionary), 0) 1238 } 1239 func FieldAddChildren(builder *flatbuffers.Builder, children flatbuffers.UOffsetT) { 1240 builder.PrependUOffsetTSlot(5, flatbuffers.UOffsetT(children), 0) 1241 } 1242 func FieldStartChildrenVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { 1243 return builder.StartVector(4, numElems, 4) 1244 } 1245 func FieldAddCustomMetadata(builder *flatbuffers.Builder, customMetadata flatbuffers.UOffsetT) { 1246 builder.PrependUOffsetTSlot(6, flatbuffers.UOffsetT(customMetadata), 0) 1247 } 1248 func FieldStartCustomMetadataVector( 1249 builder *flatbuffers.Builder, numElems int, 1250 ) flatbuffers.UOffsetT { 1251 return builder.StartVector(4, numElems, 4) 1252 } 1253 func FieldEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { 1254 return builder.EndObject() 1255 } 1256 1257 /// ---------------------------------------------------------------------- 1258 /// A Buffer represents a single contiguous memory segment 1259 type Buffer struct { 1260 _tab flatbuffers.Struct 1261 } 1262 1263 func (rcv *Buffer) Init(buf []byte, i flatbuffers.UOffsetT) { 1264 rcv._tab.Bytes = buf 1265 rcv._tab.Pos = i 1266 } 1267 1268 func (rcv *Buffer) Table() flatbuffers.Table { 1269 return rcv._tab.Table 1270 } 1271 1272 /// The relative offset into the shared memory page where the bytes for this 1273 /// buffer starts 1274 func (rcv *Buffer) Offset() int64 { 1275 return rcv._tab.GetInt64(rcv._tab.Pos + flatbuffers.UOffsetT(0)) 1276 } 1277 1278 /// The relative offset into the shared memory page where the bytes for this 1279 /// buffer starts 1280 func (rcv *Buffer) MutateOffset(n int64) bool { 1281 return rcv._tab.MutateInt64(rcv._tab.Pos+flatbuffers.UOffsetT(0), n) 1282 } 1283 1284 /// The absolute length (in bytes) of the memory buffer. The memory is found 1285 /// from offset (inclusive) to offset + length (non-inclusive). 1286 func (rcv *Buffer) Length() int64 { 1287 return rcv._tab.GetInt64(rcv._tab.Pos + flatbuffers.UOffsetT(8)) 1288 } 1289 1290 /// The absolute length (in bytes) of the memory buffer. The memory is found 1291 /// from offset (inclusive) to offset + length (non-inclusive). 1292 func (rcv *Buffer) MutateLength(n int64) bool { 1293 return rcv._tab.MutateInt64(rcv._tab.Pos+flatbuffers.UOffsetT(8), n) 1294 } 1295 1296 func CreateBuffer(builder *flatbuffers.Builder, offset int64, length int64) flatbuffers.UOffsetT { 1297 builder.Prep(8, 16) 1298 builder.PrependInt64(length) 1299 builder.PrependInt64(offset) 1300 return builder.Offset() 1301 } 1302 1303 /// ---------------------------------------------------------------------- 1304 /// A Schema describes the columns in a row batch 1305 type Schema struct { 1306 _tab flatbuffers.Table 1307 } 1308 1309 func GetRootAsSchema(buf []byte, offset flatbuffers.UOffsetT) *Schema { 1310 n := flatbuffers.GetUOffsetT(buf[offset:]) 1311 x := &Schema{} 1312 x.Init(buf, n+offset) 1313 return x 1314 } 1315 1316 func (rcv *Schema) Init(buf []byte, i flatbuffers.UOffsetT) { 1317 rcv._tab.Bytes = buf 1318 rcv._tab.Pos = i 1319 } 1320 1321 func (rcv *Schema) Table() flatbuffers.Table { 1322 return rcv._tab 1323 } 1324 1325 /// endianness of the buffer 1326 /// it is Little Endian by default 1327 /// if endianness doesn't match the underlying system then the vectors need to be converted 1328 func (rcv *Schema) Endianness() int16 { 1329 o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) 1330 if o != 0 { 1331 return rcv._tab.GetInt16(o + rcv._tab.Pos) 1332 } 1333 return 0 1334 } 1335 1336 /// endianness of the buffer 1337 /// it is Little Endian by default 1338 /// if endianness doesn't match the underlying system then the vectors need to be converted 1339 func (rcv *Schema) MutateEndianness(n int16) bool { 1340 return rcv._tab.MutateInt16Slot(4, n) 1341 } 1342 1343 func (rcv *Schema) Fields(obj *Field, j int) bool { 1344 o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) 1345 if o != 0 { 1346 x := rcv._tab.Vector(o) 1347 x += flatbuffers.UOffsetT(j) * 4 1348 x = rcv._tab.Indirect(x) 1349 obj.Init(rcv._tab.Bytes, x) 1350 return true 1351 } 1352 return false 1353 } 1354 1355 func (rcv *Schema) FieldsLength() int { 1356 o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) 1357 if o != 0 { 1358 return rcv._tab.VectorLen(o) 1359 } 1360 return 0 1361 } 1362 1363 func (rcv *Schema) CustomMetadata(obj *KeyValue, j int) bool { 1364 o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) 1365 if o != 0 { 1366 x := rcv._tab.Vector(o) 1367 x += flatbuffers.UOffsetT(j) * 4 1368 x = rcv._tab.Indirect(x) 1369 obj.Init(rcv._tab.Bytes, x) 1370 return true 1371 } 1372 return false 1373 } 1374 1375 func (rcv *Schema) CustomMetadataLength() int { 1376 o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) 1377 if o != 0 { 1378 return rcv._tab.VectorLen(o) 1379 } 1380 return 0 1381 } 1382 1383 func SchemaStart(builder *flatbuffers.Builder) { 1384 builder.StartObject(3) 1385 } 1386 func SchemaAddEndianness(builder *flatbuffers.Builder, endianness int16) { 1387 builder.PrependInt16Slot(0, endianness, 0) 1388 } 1389 func SchemaAddFields(builder *flatbuffers.Builder, fields flatbuffers.UOffsetT) { 1390 builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(fields), 0) 1391 } 1392 func SchemaStartFieldsVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { 1393 return builder.StartVector(4, numElems, 4) 1394 } 1395 func SchemaAddCustomMetadata(builder *flatbuffers.Builder, customMetadata flatbuffers.UOffsetT) { 1396 builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(customMetadata), 0) 1397 } 1398 func SchemaStartCustomMetadataVector( 1399 builder *flatbuffers.Builder, numElems int, 1400 ) flatbuffers.UOffsetT { 1401 return builder.StartVector(4, numElems, 4) 1402 } 1403 func SchemaEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { 1404 return builder.EndObject() 1405 }