github.com/dolthub/go-mysql-server@v0.18.0/sql/mysql_db/serial/mysql_db.go (about) 1 // Copyright 2022 Dolthub, Inc. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 // Code generated by the FlatBuffers compiler. DO NOT EDIT. 16 17 package serial 18 19 import ( 20 flatbuffers "github.com/dolthub/flatbuffers/v23/go" 21 ) 22 23 type PrivilegeSetColumn struct { 24 _tab flatbuffers.Table 25 } 26 27 func InitPrivilegeSetColumnRoot(o *PrivilegeSetColumn, buf []byte, offset flatbuffers.UOffsetT) error { 28 n := flatbuffers.GetUOffsetT(buf[offset:]) 29 o.Init(buf, n+offset) 30 if PrivilegeSetColumnNumFields < o.Table().NumFields() { 31 return flatbuffers.ErrTableHasUnknownFields 32 } 33 return nil 34 } 35 36 func TryGetRootAsPrivilegeSetColumn(buf []byte, offset flatbuffers.UOffsetT) (*PrivilegeSetColumn, error) { 37 x := &PrivilegeSetColumn{} 38 return x, InitPrivilegeSetColumnRoot(x, buf, offset) 39 } 40 41 func GetRootAsPrivilegeSetColumn(buf []byte, offset flatbuffers.UOffsetT) *PrivilegeSetColumn { 42 x := &PrivilegeSetColumn{} 43 InitPrivilegeSetColumnRoot(x, buf, offset) 44 return x 45 } 46 47 func TryGetSizePrefixedRootAsPrivilegeSetColumn(buf []byte, offset flatbuffers.UOffsetT) (*PrivilegeSetColumn, error) { 48 x := &PrivilegeSetColumn{} 49 return x, InitPrivilegeSetColumnRoot(x, buf, offset+flatbuffers.SizeUint32) 50 } 51 52 func GetSizePrefixedRootAsPrivilegeSetColumn(buf []byte, offset flatbuffers.UOffsetT) *PrivilegeSetColumn { 53 x := &PrivilegeSetColumn{} 54 InitPrivilegeSetColumnRoot(x, buf, offset+flatbuffers.SizeUint32) 55 return x 56 } 57 58 func (rcv *PrivilegeSetColumn) Init(buf []byte, i flatbuffers.UOffsetT) { 59 rcv._tab.Bytes = buf 60 rcv._tab.Pos = i 61 } 62 63 func (rcv *PrivilegeSetColumn) Table() flatbuffers.Table { 64 return rcv._tab 65 } 66 67 func (rcv *PrivilegeSetColumn) Name() []byte { 68 o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) 69 if o != 0 { 70 return rcv._tab.ByteVector(o + rcv._tab.Pos) 71 } 72 return nil 73 } 74 75 func (rcv *PrivilegeSetColumn) Privs(j int) int32 { 76 o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) 77 if o != 0 { 78 a := rcv._tab.Vector(o) 79 return rcv._tab.GetInt32(a + flatbuffers.UOffsetT(j*4)) 80 } 81 return 0 82 } 83 84 func (rcv *PrivilegeSetColumn) PrivsLength() int { 85 o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) 86 if o != 0 { 87 return rcv._tab.VectorLen(o) 88 } 89 return 0 90 } 91 92 func (rcv *PrivilegeSetColumn) MutatePrivs(j int, n int32) bool { 93 o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) 94 if o != 0 { 95 a := rcv._tab.Vector(o) 96 return rcv._tab.MutateInt32(a+flatbuffers.UOffsetT(j*4), n) 97 } 98 return false 99 } 100 101 const PrivilegeSetColumnNumFields = 2 102 103 func PrivilegeSetColumnStart(builder *flatbuffers.Builder) { 104 builder.StartObject(PrivilegeSetColumnNumFields) 105 } 106 func PrivilegeSetColumnAddName(builder *flatbuffers.Builder, name flatbuffers.UOffsetT) { 107 builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(name), 0) 108 } 109 func PrivilegeSetColumnAddPrivs(builder *flatbuffers.Builder, privs flatbuffers.UOffsetT) { 110 builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(privs), 0) 111 } 112 func PrivilegeSetColumnStartPrivsVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { 113 return builder.StartVector(4, numElems, 4) 114 } 115 func PrivilegeSetColumnEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { 116 return builder.EndObject() 117 } 118 119 type PrivilegeSetTable struct { 120 _tab flatbuffers.Table 121 } 122 123 func InitPrivilegeSetTableRoot(o *PrivilegeSetTable, buf []byte, offset flatbuffers.UOffsetT) error { 124 n := flatbuffers.GetUOffsetT(buf[offset:]) 125 o.Init(buf, n+offset) 126 if PrivilegeSetTableNumFields < o.Table().NumFields() { 127 return flatbuffers.ErrTableHasUnknownFields 128 } 129 return nil 130 } 131 132 func TryGetRootAsPrivilegeSetTable(buf []byte, offset flatbuffers.UOffsetT) (*PrivilegeSetTable, error) { 133 x := &PrivilegeSetTable{} 134 return x, InitPrivilegeSetTableRoot(x, buf, offset) 135 } 136 137 func GetRootAsPrivilegeSetTable(buf []byte, offset flatbuffers.UOffsetT) *PrivilegeSetTable { 138 x := &PrivilegeSetTable{} 139 InitPrivilegeSetTableRoot(x, buf, offset) 140 return x 141 } 142 143 func TryGetSizePrefixedRootAsPrivilegeSetTable(buf []byte, offset flatbuffers.UOffsetT) (*PrivilegeSetTable, error) { 144 x := &PrivilegeSetTable{} 145 return x, InitPrivilegeSetTableRoot(x, buf, offset+flatbuffers.SizeUint32) 146 } 147 148 func GetSizePrefixedRootAsPrivilegeSetTable(buf []byte, offset flatbuffers.UOffsetT) *PrivilegeSetTable { 149 x := &PrivilegeSetTable{} 150 InitPrivilegeSetTableRoot(x, buf, offset+flatbuffers.SizeUint32) 151 return x 152 } 153 154 func (rcv *PrivilegeSetTable) Init(buf []byte, i flatbuffers.UOffsetT) { 155 rcv._tab.Bytes = buf 156 rcv._tab.Pos = i 157 } 158 159 func (rcv *PrivilegeSetTable) Table() flatbuffers.Table { 160 return rcv._tab 161 } 162 163 func (rcv *PrivilegeSetTable) Name() []byte { 164 o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) 165 if o != 0 { 166 return rcv._tab.ByteVector(o + rcv._tab.Pos) 167 } 168 return nil 169 } 170 171 func (rcv *PrivilegeSetTable) Privs(j int) int32 { 172 o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) 173 if o != 0 { 174 a := rcv._tab.Vector(o) 175 return rcv._tab.GetInt32(a + flatbuffers.UOffsetT(j*4)) 176 } 177 return 0 178 } 179 180 func (rcv *PrivilegeSetTable) PrivsLength() int { 181 o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) 182 if o != 0 { 183 return rcv._tab.VectorLen(o) 184 } 185 return 0 186 } 187 188 func (rcv *PrivilegeSetTable) MutatePrivs(j int, n int32) bool { 189 o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) 190 if o != 0 { 191 a := rcv._tab.Vector(o) 192 return rcv._tab.MutateInt32(a+flatbuffers.UOffsetT(j*4), n) 193 } 194 return false 195 } 196 197 func (rcv *PrivilegeSetTable) Columns(obj *PrivilegeSetColumn, j int) bool { 198 o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) 199 if o != 0 { 200 x := rcv._tab.Vector(o) 201 x += flatbuffers.UOffsetT(j) * 4 202 x = rcv._tab.Indirect(x) 203 obj.Init(rcv._tab.Bytes, x) 204 return true 205 } 206 return false 207 } 208 209 func (rcv *PrivilegeSetTable) TryColumns(obj *PrivilegeSetColumn, j int) (bool, error) { 210 o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) 211 if o != 0 { 212 x := rcv._tab.Vector(o) 213 x += flatbuffers.UOffsetT(j) * 4 214 x = rcv._tab.Indirect(x) 215 obj.Init(rcv._tab.Bytes, x) 216 if PrivilegeSetColumnNumFields < obj.Table().NumFields() { 217 return false, flatbuffers.ErrTableHasUnknownFields 218 } 219 return true, nil 220 } 221 return false, nil 222 } 223 224 func (rcv *PrivilegeSetTable) ColumnsLength() int { 225 o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) 226 if o != 0 { 227 return rcv._tab.VectorLen(o) 228 } 229 return 0 230 } 231 232 const PrivilegeSetTableNumFields = 3 233 234 func PrivilegeSetTableStart(builder *flatbuffers.Builder) { 235 builder.StartObject(PrivilegeSetTableNumFields) 236 } 237 func PrivilegeSetTableAddName(builder *flatbuffers.Builder, name flatbuffers.UOffsetT) { 238 builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(name), 0) 239 } 240 func PrivilegeSetTableAddPrivs(builder *flatbuffers.Builder, privs flatbuffers.UOffsetT) { 241 builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(privs), 0) 242 } 243 func PrivilegeSetTableStartPrivsVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { 244 return builder.StartVector(4, numElems, 4) 245 } 246 func PrivilegeSetTableAddColumns(builder *flatbuffers.Builder, columns flatbuffers.UOffsetT) { 247 builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(columns), 0) 248 } 249 func PrivilegeSetTableStartColumnsVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { 250 return builder.StartVector(4, numElems, 4) 251 } 252 func PrivilegeSetTableEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { 253 return builder.EndObject() 254 } 255 256 type PrivilegeSetRoutine struct { 257 _tab flatbuffers.Table 258 } 259 260 func InitPrivilegeSetRoutineRoot(o *PrivilegeSetRoutine, buf []byte, offset flatbuffers.UOffsetT) error { 261 n := flatbuffers.GetUOffsetT(buf[offset:]) 262 o.Init(buf, n+offset) 263 if PrivilegeSetRoutineNumFields < o.Table().NumFields() { 264 return flatbuffers.ErrTableHasUnknownFields 265 } 266 return nil 267 } 268 269 func TryGetRootAsPrivilegeSetRoutine(buf []byte, offset flatbuffers.UOffsetT) (*PrivilegeSetRoutine, error) { 270 x := &PrivilegeSetRoutine{} 271 return x, InitPrivilegeSetRoutineRoot(x, buf, offset) 272 } 273 274 func GetRootAsPrivilegeSetRoutine(buf []byte, offset flatbuffers.UOffsetT) *PrivilegeSetRoutine { 275 x := &PrivilegeSetRoutine{} 276 InitPrivilegeSetRoutineRoot(x, buf, offset) 277 return x 278 } 279 280 func TryGetSizePrefixedRootAsPrivilegeSetRoutine(buf []byte, offset flatbuffers.UOffsetT) (*PrivilegeSetRoutine, error) { 281 x := &PrivilegeSetRoutine{} 282 return x, InitPrivilegeSetRoutineRoot(x, buf, offset+flatbuffers.SizeUint32) 283 } 284 285 func GetSizePrefixedRootAsPrivilegeSetRoutine(buf []byte, offset flatbuffers.UOffsetT) *PrivilegeSetRoutine { 286 x := &PrivilegeSetRoutine{} 287 InitPrivilegeSetRoutineRoot(x, buf, offset+flatbuffers.SizeUint32) 288 return x 289 } 290 291 func (rcv *PrivilegeSetRoutine) Init(buf []byte, i flatbuffers.UOffsetT) { 292 rcv._tab.Bytes = buf 293 rcv._tab.Pos = i 294 } 295 296 func (rcv *PrivilegeSetRoutine) Table() flatbuffers.Table { 297 return rcv._tab 298 } 299 300 func (rcv *PrivilegeSetRoutine) Name() []byte { 301 o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) 302 if o != 0 { 303 return rcv._tab.ByteVector(o + rcv._tab.Pos) 304 } 305 return nil 306 } 307 308 func (rcv *PrivilegeSetRoutine) Privs(j int) int32 { 309 o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) 310 if o != 0 { 311 a := rcv._tab.Vector(o) 312 return rcv._tab.GetInt32(a + flatbuffers.UOffsetT(j*4)) 313 } 314 return 0 315 } 316 317 func (rcv *PrivilegeSetRoutine) PrivsLength() int { 318 o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) 319 if o != 0 { 320 return rcv._tab.VectorLen(o) 321 } 322 return 0 323 } 324 325 func (rcv *PrivilegeSetRoutine) MutatePrivs(j int, n int32) bool { 326 o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) 327 if o != 0 { 328 a := rcv._tab.Vector(o) 329 return rcv._tab.MutateInt32(a+flatbuffers.UOffsetT(j*4), n) 330 } 331 return false 332 } 333 334 func (rcv *PrivilegeSetRoutine) IsProc() bool { 335 o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) 336 if o != 0 { 337 return rcv._tab.GetBool(o + rcv._tab.Pos) 338 } 339 return false 340 } 341 342 func (rcv *PrivilegeSetRoutine) MutateIsProc(n bool) bool { 343 return rcv._tab.MutateBoolSlot(8, n) 344 } 345 346 const PrivilegeSetRoutineNumFields = 3 347 348 func PrivilegeSetRoutineStart(builder *flatbuffers.Builder) { 349 builder.StartObject(PrivilegeSetRoutineNumFields) 350 } 351 func PrivilegeSetRoutineAddName(builder *flatbuffers.Builder, name flatbuffers.UOffsetT) { 352 builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(name), 0) 353 } 354 func PrivilegeSetRoutineAddPrivs(builder *flatbuffers.Builder, privs flatbuffers.UOffsetT) { 355 builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(privs), 0) 356 } 357 func PrivilegeSetRoutineStartPrivsVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { 358 return builder.StartVector(4, numElems, 4) 359 } 360 func PrivilegeSetRoutineAddIsProc(builder *flatbuffers.Builder, isProc bool) { 361 builder.PrependBoolSlot(2, isProc, false) 362 } 363 func PrivilegeSetRoutineEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { 364 return builder.EndObject() 365 } 366 367 type PrivilegeSetDatabase struct { 368 _tab flatbuffers.Table 369 } 370 371 func InitPrivilegeSetDatabaseRoot(o *PrivilegeSetDatabase, buf []byte, offset flatbuffers.UOffsetT) error { 372 n := flatbuffers.GetUOffsetT(buf[offset:]) 373 o.Init(buf, n+offset) 374 if PrivilegeSetDatabaseNumFields < o.Table().NumFields() { 375 return flatbuffers.ErrTableHasUnknownFields 376 } 377 return nil 378 } 379 380 func TryGetRootAsPrivilegeSetDatabase(buf []byte, offset flatbuffers.UOffsetT) (*PrivilegeSetDatabase, error) { 381 x := &PrivilegeSetDatabase{} 382 return x, InitPrivilegeSetDatabaseRoot(x, buf, offset) 383 } 384 385 func GetRootAsPrivilegeSetDatabase(buf []byte, offset flatbuffers.UOffsetT) *PrivilegeSetDatabase { 386 x := &PrivilegeSetDatabase{} 387 InitPrivilegeSetDatabaseRoot(x, buf, offset) 388 return x 389 } 390 391 func TryGetSizePrefixedRootAsPrivilegeSetDatabase(buf []byte, offset flatbuffers.UOffsetT) (*PrivilegeSetDatabase, error) { 392 x := &PrivilegeSetDatabase{} 393 return x, InitPrivilegeSetDatabaseRoot(x, buf, offset+flatbuffers.SizeUint32) 394 } 395 396 func GetSizePrefixedRootAsPrivilegeSetDatabase(buf []byte, offset flatbuffers.UOffsetT) *PrivilegeSetDatabase { 397 x := &PrivilegeSetDatabase{} 398 InitPrivilegeSetDatabaseRoot(x, buf, offset+flatbuffers.SizeUint32) 399 return x 400 } 401 402 func (rcv *PrivilegeSetDatabase) Init(buf []byte, i flatbuffers.UOffsetT) { 403 rcv._tab.Bytes = buf 404 rcv._tab.Pos = i 405 } 406 407 func (rcv *PrivilegeSetDatabase) Table() flatbuffers.Table { 408 return rcv._tab 409 } 410 411 func (rcv *PrivilegeSetDatabase) Name() []byte { 412 o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) 413 if o != 0 { 414 return rcv._tab.ByteVector(o + rcv._tab.Pos) 415 } 416 return nil 417 } 418 419 func (rcv *PrivilegeSetDatabase) Privs(j int) int32 { 420 o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) 421 if o != 0 { 422 a := rcv._tab.Vector(o) 423 return rcv._tab.GetInt32(a + flatbuffers.UOffsetT(j*4)) 424 } 425 return 0 426 } 427 428 func (rcv *PrivilegeSetDatabase) PrivsLength() int { 429 o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) 430 if o != 0 { 431 return rcv._tab.VectorLen(o) 432 } 433 return 0 434 } 435 436 func (rcv *PrivilegeSetDatabase) MutatePrivs(j int, n int32) bool { 437 o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) 438 if o != 0 { 439 a := rcv._tab.Vector(o) 440 return rcv._tab.MutateInt32(a+flatbuffers.UOffsetT(j*4), n) 441 } 442 return false 443 } 444 445 func (rcv *PrivilegeSetDatabase) Tables(obj *PrivilegeSetTable, j int) bool { 446 o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) 447 if o != 0 { 448 x := rcv._tab.Vector(o) 449 x += flatbuffers.UOffsetT(j) * 4 450 x = rcv._tab.Indirect(x) 451 obj.Init(rcv._tab.Bytes, x) 452 return true 453 } 454 return false 455 } 456 457 func (rcv *PrivilegeSetDatabase) TryTables(obj *PrivilegeSetTable, j int) (bool, error) { 458 o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) 459 if o != 0 { 460 x := rcv._tab.Vector(o) 461 x += flatbuffers.UOffsetT(j) * 4 462 x = rcv._tab.Indirect(x) 463 obj.Init(rcv._tab.Bytes, x) 464 if PrivilegeSetTableNumFields < obj.Table().NumFields() { 465 return false, flatbuffers.ErrTableHasUnknownFields 466 } 467 return true, nil 468 } 469 return false, nil 470 } 471 472 func (rcv *PrivilegeSetDatabase) TablesLength() int { 473 o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) 474 if o != 0 { 475 return rcv._tab.VectorLen(o) 476 } 477 return 0 478 } 479 480 func (rcv *PrivilegeSetDatabase) Routines(obj *PrivilegeSetRoutine, j int) bool { 481 o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) 482 if o != 0 { 483 x := rcv._tab.Vector(o) 484 x += flatbuffers.UOffsetT(j) * 4 485 x = rcv._tab.Indirect(x) 486 obj.Init(rcv._tab.Bytes, x) 487 return true 488 } 489 return false 490 } 491 492 func (rcv *PrivilegeSetDatabase) TryRoutines(obj *PrivilegeSetRoutine, j int) (bool, error) { 493 o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) 494 if o != 0 { 495 x := rcv._tab.Vector(o) 496 x += flatbuffers.UOffsetT(j) * 4 497 x = rcv._tab.Indirect(x) 498 obj.Init(rcv._tab.Bytes, x) 499 if PrivilegeSetRoutineNumFields < obj.Table().NumFields() { 500 return false, flatbuffers.ErrTableHasUnknownFields 501 } 502 return true, nil 503 } 504 return false, nil 505 } 506 507 func (rcv *PrivilegeSetDatabase) RoutinesLength() int { 508 o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) 509 if o != 0 { 510 return rcv._tab.VectorLen(o) 511 } 512 return 0 513 } 514 515 const PrivilegeSetDatabaseNumFields = 4 516 517 func PrivilegeSetDatabaseStart(builder *flatbuffers.Builder) { 518 builder.StartObject(PrivilegeSetDatabaseNumFields) 519 } 520 func PrivilegeSetDatabaseAddName(builder *flatbuffers.Builder, name flatbuffers.UOffsetT) { 521 builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(name), 0) 522 } 523 func PrivilegeSetDatabaseAddPrivs(builder *flatbuffers.Builder, privs flatbuffers.UOffsetT) { 524 builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(privs), 0) 525 } 526 func PrivilegeSetDatabaseStartPrivsVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { 527 return builder.StartVector(4, numElems, 4) 528 } 529 func PrivilegeSetDatabaseAddTables(builder *flatbuffers.Builder, tables flatbuffers.UOffsetT) { 530 builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(tables), 0) 531 } 532 func PrivilegeSetDatabaseStartTablesVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { 533 return builder.StartVector(4, numElems, 4) 534 } 535 func PrivilegeSetDatabaseAddRoutines(builder *flatbuffers.Builder, routines flatbuffers.UOffsetT) { 536 builder.PrependUOffsetTSlot(3, flatbuffers.UOffsetT(routines), 0) 537 } 538 func PrivilegeSetDatabaseStartRoutinesVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { 539 return builder.StartVector(4, numElems, 4) 540 } 541 func PrivilegeSetDatabaseEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { 542 return builder.EndObject() 543 } 544 545 type PrivilegeSet struct { 546 _tab flatbuffers.Table 547 } 548 549 func InitPrivilegeSetRoot(o *PrivilegeSet, buf []byte, offset flatbuffers.UOffsetT) error { 550 n := flatbuffers.GetUOffsetT(buf[offset:]) 551 o.Init(buf, n+offset) 552 if PrivilegeSetNumFields < o.Table().NumFields() { 553 return flatbuffers.ErrTableHasUnknownFields 554 } 555 return nil 556 } 557 558 func TryGetRootAsPrivilegeSet(buf []byte, offset flatbuffers.UOffsetT) (*PrivilegeSet, error) { 559 x := &PrivilegeSet{} 560 return x, InitPrivilegeSetRoot(x, buf, offset) 561 } 562 563 func GetRootAsPrivilegeSet(buf []byte, offset flatbuffers.UOffsetT) *PrivilegeSet { 564 x := &PrivilegeSet{} 565 InitPrivilegeSetRoot(x, buf, offset) 566 return x 567 } 568 569 func TryGetSizePrefixedRootAsPrivilegeSet(buf []byte, offset flatbuffers.UOffsetT) (*PrivilegeSet, error) { 570 x := &PrivilegeSet{} 571 return x, InitPrivilegeSetRoot(x, buf, offset+flatbuffers.SizeUint32) 572 } 573 574 func GetSizePrefixedRootAsPrivilegeSet(buf []byte, offset flatbuffers.UOffsetT) *PrivilegeSet { 575 x := &PrivilegeSet{} 576 InitPrivilegeSetRoot(x, buf, offset+flatbuffers.SizeUint32) 577 return x 578 } 579 580 func (rcv *PrivilegeSet) Init(buf []byte, i flatbuffers.UOffsetT) { 581 rcv._tab.Bytes = buf 582 rcv._tab.Pos = i 583 } 584 585 func (rcv *PrivilegeSet) Table() flatbuffers.Table { 586 return rcv._tab 587 } 588 589 func (rcv *PrivilegeSet) GlobalStatic(j int) int32 { 590 o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) 591 if o != 0 { 592 a := rcv._tab.Vector(o) 593 return rcv._tab.GetInt32(a + flatbuffers.UOffsetT(j*4)) 594 } 595 return 0 596 } 597 598 func (rcv *PrivilegeSet) GlobalStaticLength() int { 599 o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) 600 if o != 0 { 601 return rcv._tab.VectorLen(o) 602 } 603 return 0 604 } 605 606 func (rcv *PrivilegeSet) MutateGlobalStatic(j int, n int32) bool { 607 o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) 608 if o != 0 { 609 a := rcv._tab.Vector(o) 610 return rcv._tab.MutateInt32(a+flatbuffers.UOffsetT(j*4), n) 611 } 612 return false 613 } 614 615 func (rcv *PrivilegeSet) GlobalDynamic(j int) []byte { 616 o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) 617 if o != 0 { 618 a := rcv._tab.Vector(o) 619 return rcv._tab.ByteVector(a + flatbuffers.UOffsetT(j*4)) 620 } 621 return nil 622 } 623 624 func (rcv *PrivilegeSet) GlobalDynamicLength() int { 625 o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) 626 if o != 0 { 627 return rcv._tab.VectorLen(o) 628 } 629 return 0 630 } 631 632 func (rcv *PrivilegeSet) Databases(obj *PrivilegeSetDatabase, j int) bool { 633 o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) 634 if o != 0 { 635 x := rcv._tab.Vector(o) 636 x += flatbuffers.UOffsetT(j) * 4 637 x = rcv._tab.Indirect(x) 638 obj.Init(rcv._tab.Bytes, x) 639 return true 640 } 641 return false 642 } 643 644 func (rcv *PrivilegeSet) TryDatabases(obj *PrivilegeSetDatabase, j int) (bool, error) { 645 o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) 646 if o != 0 { 647 x := rcv._tab.Vector(o) 648 x += flatbuffers.UOffsetT(j) * 4 649 x = rcv._tab.Indirect(x) 650 obj.Init(rcv._tab.Bytes, x) 651 if PrivilegeSetDatabaseNumFields < obj.Table().NumFields() { 652 return false, flatbuffers.ErrTableHasUnknownFields 653 } 654 return true, nil 655 } 656 return false, nil 657 } 658 659 func (rcv *PrivilegeSet) DatabasesLength() int { 660 o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) 661 if o != 0 { 662 return rcv._tab.VectorLen(o) 663 } 664 return 0 665 } 666 667 func (rcv *PrivilegeSet) GlobalDynamicWgo(j int) bool { 668 o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) 669 if o != 0 { 670 a := rcv._tab.Vector(o) 671 return rcv._tab.GetBool(a + flatbuffers.UOffsetT(j*1)) 672 } 673 return false 674 } 675 676 func (rcv *PrivilegeSet) GlobalDynamicWgoLength() int { 677 o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) 678 if o != 0 { 679 return rcv._tab.VectorLen(o) 680 } 681 return 0 682 } 683 684 func (rcv *PrivilegeSet) MutateGlobalDynamicWgo(j int, n bool) bool { 685 o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) 686 if o != 0 { 687 a := rcv._tab.Vector(o) 688 return rcv._tab.MutateBool(a+flatbuffers.UOffsetT(j*1), n) 689 } 690 return false 691 } 692 693 const PrivilegeSetNumFields = 4 694 695 func PrivilegeSetStart(builder *flatbuffers.Builder) { 696 builder.StartObject(PrivilegeSetNumFields) 697 } 698 func PrivilegeSetAddGlobalStatic(builder *flatbuffers.Builder, globalStatic flatbuffers.UOffsetT) { 699 builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(globalStatic), 0) 700 } 701 func PrivilegeSetStartGlobalStaticVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { 702 return builder.StartVector(4, numElems, 4) 703 } 704 func PrivilegeSetAddGlobalDynamic(builder *flatbuffers.Builder, globalDynamic flatbuffers.UOffsetT) { 705 builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(globalDynamic), 0) 706 } 707 func PrivilegeSetStartGlobalDynamicVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { 708 return builder.StartVector(4, numElems, 4) 709 } 710 func PrivilegeSetAddDatabases(builder *flatbuffers.Builder, databases flatbuffers.UOffsetT) { 711 builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(databases), 0) 712 } 713 func PrivilegeSetStartDatabasesVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { 714 return builder.StartVector(4, numElems, 4) 715 } 716 func PrivilegeSetAddGlobalDynamicWgo(builder *flatbuffers.Builder, globalDynamicWgo flatbuffers.UOffsetT) { 717 builder.PrependUOffsetTSlot(3, flatbuffers.UOffsetT(globalDynamicWgo), 0) 718 } 719 func PrivilegeSetStartGlobalDynamicWgoVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { 720 return builder.StartVector(1, numElems, 1) 721 } 722 func PrivilegeSetEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { 723 return builder.EndObject() 724 } 725 726 type User struct { 727 _tab flatbuffers.Table 728 } 729 730 func InitUserRoot(o *User, buf []byte, offset flatbuffers.UOffsetT) error { 731 n := flatbuffers.GetUOffsetT(buf[offset:]) 732 o.Init(buf, n+offset) 733 if UserNumFields < o.Table().NumFields() { 734 return flatbuffers.ErrTableHasUnknownFields 735 } 736 return nil 737 } 738 739 func TryGetRootAsUser(buf []byte, offset flatbuffers.UOffsetT) (*User, error) { 740 x := &User{} 741 return x, InitUserRoot(x, buf, offset) 742 } 743 744 func GetRootAsUser(buf []byte, offset flatbuffers.UOffsetT) *User { 745 x := &User{} 746 InitUserRoot(x, buf, offset) 747 return x 748 } 749 750 func TryGetSizePrefixedRootAsUser(buf []byte, offset flatbuffers.UOffsetT) (*User, error) { 751 x := &User{} 752 return x, InitUserRoot(x, buf, offset+flatbuffers.SizeUint32) 753 } 754 755 func GetSizePrefixedRootAsUser(buf []byte, offset flatbuffers.UOffsetT) *User { 756 x := &User{} 757 InitUserRoot(x, buf, offset+flatbuffers.SizeUint32) 758 return x 759 } 760 761 func (rcv *User) Init(buf []byte, i flatbuffers.UOffsetT) { 762 rcv._tab.Bytes = buf 763 rcv._tab.Pos = i 764 } 765 766 func (rcv *User) Table() flatbuffers.Table { 767 return rcv._tab 768 } 769 770 func (rcv *User) User() []byte { 771 o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) 772 if o != 0 { 773 return rcv._tab.ByteVector(o + rcv._tab.Pos) 774 } 775 return nil 776 } 777 778 func (rcv *User) Host() []byte { 779 o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) 780 if o != 0 { 781 return rcv._tab.ByteVector(o + rcv._tab.Pos) 782 } 783 return nil 784 } 785 786 func (rcv *User) PrivilegeSet(obj *PrivilegeSet) *PrivilegeSet { 787 o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) 788 if o != 0 { 789 x := rcv._tab.Indirect(o + rcv._tab.Pos) 790 if obj == nil { 791 obj = new(PrivilegeSet) 792 } 793 obj.Init(rcv._tab.Bytes, x) 794 return obj 795 } 796 return nil 797 } 798 799 func (rcv *User) TryPrivilegeSet(obj *PrivilegeSet) (*PrivilegeSet, error) { 800 o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) 801 if o != 0 { 802 x := rcv._tab.Indirect(o + rcv._tab.Pos) 803 if obj == nil { 804 obj = new(PrivilegeSet) 805 } 806 obj.Init(rcv._tab.Bytes, x) 807 if PrivilegeSetNumFields < obj.Table().NumFields() { 808 return nil, flatbuffers.ErrTableHasUnknownFields 809 } 810 return obj, nil 811 } 812 return nil, nil 813 } 814 815 func (rcv *User) Plugin() []byte { 816 o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) 817 if o != 0 { 818 return rcv._tab.ByteVector(o + rcv._tab.Pos) 819 } 820 return nil 821 } 822 823 func (rcv *User) Password() []byte { 824 o := flatbuffers.UOffsetT(rcv._tab.Offset(12)) 825 if o != 0 { 826 return rcv._tab.ByteVector(o + rcv._tab.Pos) 827 } 828 return nil 829 } 830 831 func (rcv *User) PasswordLastChanged() int64 { 832 o := flatbuffers.UOffsetT(rcv._tab.Offset(14)) 833 if o != 0 { 834 return rcv._tab.GetInt64(o + rcv._tab.Pos) 835 } 836 return 0 837 } 838 839 func (rcv *User) MutatePasswordLastChanged(n int64) bool { 840 return rcv._tab.MutateInt64Slot(14, n) 841 } 842 843 func (rcv *User) Locked() bool { 844 o := flatbuffers.UOffsetT(rcv._tab.Offset(16)) 845 if o != 0 { 846 return rcv._tab.GetBool(o + rcv._tab.Pos) 847 } 848 return false 849 } 850 851 func (rcv *User) MutateLocked(n bool) bool { 852 return rcv._tab.MutateBoolSlot(16, n) 853 } 854 855 func (rcv *User) Attributes() []byte { 856 o := flatbuffers.UOffsetT(rcv._tab.Offset(18)) 857 if o != 0 { 858 return rcv._tab.ByteVector(o + rcv._tab.Pos) 859 } 860 return nil 861 } 862 863 func (rcv *User) Identity() []byte { 864 o := flatbuffers.UOffsetT(rcv._tab.Offset(20)) 865 if o != 0 { 866 return rcv._tab.ByteVector(o + rcv._tab.Pos) 867 } 868 return nil 869 } 870 871 const UserNumFields = 9 872 873 func UserStart(builder *flatbuffers.Builder) { 874 builder.StartObject(UserNumFields) 875 } 876 func UserAddUser(builder *flatbuffers.Builder, user flatbuffers.UOffsetT) { 877 builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(user), 0) 878 } 879 func UserAddHost(builder *flatbuffers.Builder, host flatbuffers.UOffsetT) { 880 builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(host), 0) 881 } 882 func UserAddPrivilegeSet(builder *flatbuffers.Builder, privilegeSet flatbuffers.UOffsetT) { 883 builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(privilegeSet), 0) 884 } 885 func UserAddPlugin(builder *flatbuffers.Builder, plugin flatbuffers.UOffsetT) { 886 builder.PrependUOffsetTSlot(3, flatbuffers.UOffsetT(plugin), 0) 887 } 888 func UserAddPassword(builder *flatbuffers.Builder, password flatbuffers.UOffsetT) { 889 builder.PrependUOffsetTSlot(4, flatbuffers.UOffsetT(password), 0) 890 } 891 func UserAddPasswordLastChanged(builder *flatbuffers.Builder, passwordLastChanged int64) { 892 builder.PrependInt64Slot(5, passwordLastChanged, 0) 893 } 894 func UserAddLocked(builder *flatbuffers.Builder, locked bool) { 895 builder.PrependBoolSlot(6, locked, false) 896 } 897 func UserAddAttributes(builder *flatbuffers.Builder, attributes flatbuffers.UOffsetT) { 898 builder.PrependUOffsetTSlot(7, flatbuffers.UOffsetT(attributes), 0) 899 } 900 func UserAddIdentity(builder *flatbuffers.Builder, identity flatbuffers.UOffsetT) { 901 builder.PrependUOffsetTSlot(8, flatbuffers.UOffsetT(identity), 0) 902 } 903 func UserEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { 904 return builder.EndObject() 905 } 906 907 type RoleEdge struct { 908 _tab flatbuffers.Table 909 } 910 911 func InitRoleEdgeRoot(o *RoleEdge, buf []byte, offset flatbuffers.UOffsetT) error { 912 n := flatbuffers.GetUOffsetT(buf[offset:]) 913 o.Init(buf, n+offset) 914 if RoleEdgeNumFields < o.Table().NumFields() { 915 return flatbuffers.ErrTableHasUnknownFields 916 } 917 return nil 918 } 919 920 func TryGetRootAsRoleEdge(buf []byte, offset flatbuffers.UOffsetT) (*RoleEdge, error) { 921 x := &RoleEdge{} 922 return x, InitRoleEdgeRoot(x, buf, offset) 923 } 924 925 func GetRootAsRoleEdge(buf []byte, offset flatbuffers.UOffsetT) *RoleEdge { 926 x := &RoleEdge{} 927 InitRoleEdgeRoot(x, buf, offset) 928 return x 929 } 930 931 func TryGetSizePrefixedRootAsRoleEdge(buf []byte, offset flatbuffers.UOffsetT) (*RoleEdge, error) { 932 x := &RoleEdge{} 933 return x, InitRoleEdgeRoot(x, buf, offset+flatbuffers.SizeUint32) 934 } 935 936 func GetSizePrefixedRootAsRoleEdge(buf []byte, offset flatbuffers.UOffsetT) *RoleEdge { 937 x := &RoleEdge{} 938 InitRoleEdgeRoot(x, buf, offset+flatbuffers.SizeUint32) 939 return x 940 } 941 942 func (rcv *RoleEdge) Init(buf []byte, i flatbuffers.UOffsetT) { 943 rcv._tab.Bytes = buf 944 rcv._tab.Pos = i 945 } 946 947 func (rcv *RoleEdge) Table() flatbuffers.Table { 948 return rcv._tab 949 } 950 951 func (rcv *RoleEdge) FromHost() []byte { 952 o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) 953 if o != 0 { 954 return rcv._tab.ByteVector(o + rcv._tab.Pos) 955 } 956 return nil 957 } 958 959 func (rcv *RoleEdge) FromUser() []byte { 960 o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) 961 if o != 0 { 962 return rcv._tab.ByteVector(o + rcv._tab.Pos) 963 } 964 return nil 965 } 966 967 func (rcv *RoleEdge) ToHost() []byte { 968 o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) 969 if o != 0 { 970 return rcv._tab.ByteVector(o + rcv._tab.Pos) 971 } 972 return nil 973 } 974 975 func (rcv *RoleEdge) ToUser() []byte { 976 o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) 977 if o != 0 { 978 return rcv._tab.ByteVector(o + rcv._tab.Pos) 979 } 980 return nil 981 } 982 983 func (rcv *RoleEdge) WithAdminOption() bool { 984 o := flatbuffers.UOffsetT(rcv._tab.Offset(12)) 985 if o != 0 { 986 return rcv._tab.GetBool(o + rcv._tab.Pos) 987 } 988 return false 989 } 990 991 func (rcv *RoleEdge) MutateWithAdminOption(n bool) bool { 992 return rcv._tab.MutateBoolSlot(12, n) 993 } 994 995 const RoleEdgeNumFields = 5 996 997 func RoleEdgeStart(builder *flatbuffers.Builder) { 998 builder.StartObject(RoleEdgeNumFields) 999 } 1000 func RoleEdgeAddFromHost(builder *flatbuffers.Builder, fromHost flatbuffers.UOffsetT) { 1001 builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(fromHost), 0) 1002 } 1003 func RoleEdgeAddFromUser(builder *flatbuffers.Builder, fromUser flatbuffers.UOffsetT) { 1004 builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(fromUser), 0) 1005 } 1006 func RoleEdgeAddToHost(builder *flatbuffers.Builder, toHost flatbuffers.UOffsetT) { 1007 builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(toHost), 0) 1008 } 1009 func RoleEdgeAddToUser(builder *flatbuffers.Builder, toUser flatbuffers.UOffsetT) { 1010 builder.PrependUOffsetTSlot(3, flatbuffers.UOffsetT(toUser), 0) 1011 } 1012 func RoleEdgeAddWithAdminOption(builder *flatbuffers.Builder, withAdminOption bool) { 1013 builder.PrependBoolSlot(4, withAdminOption, false) 1014 } 1015 func RoleEdgeEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { 1016 return builder.EndObject() 1017 } 1018 1019 type ReplicaSourceInfo struct { 1020 _tab flatbuffers.Table 1021 } 1022 1023 func InitReplicaSourceInfoRoot(o *ReplicaSourceInfo, buf []byte, offset flatbuffers.UOffsetT) error { 1024 n := flatbuffers.GetUOffsetT(buf[offset:]) 1025 o.Init(buf, n+offset) 1026 if ReplicaSourceInfoNumFields < o.Table().NumFields() { 1027 return flatbuffers.ErrTableHasUnknownFields 1028 } 1029 return nil 1030 } 1031 1032 func TryGetRootAsReplicaSourceInfo(buf []byte, offset flatbuffers.UOffsetT) (*ReplicaSourceInfo, error) { 1033 x := &ReplicaSourceInfo{} 1034 return x, InitReplicaSourceInfoRoot(x, buf, offset) 1035 } 1036 1037 func GetRootAsReplicaSourceInfo(buf []byte, offset flatbuffers.UOffsetT) *ReplicaSourceInfo { 1038 x := &ReplicaSourceInfo{} 1039 InitReplicaSourceInfoRoot(x, buf, offset) 1040 return x 1041 } 1042 1043 func TryGetSizePrefixedRootAsReplicaSourceInfo(buf []byte, offset flatbuffers.UOffsetT) (*ReplicaSourceInfo, error) { 1044 x := &ReplicaSourceInfo{} 1045 return x, InitReplicaSourceInfoRoot(x, buf, offset+flatbuffers.SizeUint32) 1046 } 1047 1048 func GetSizePrefixedRootAsReplicaSourceInfo(buf []byte, offset flatbuffers.UOffsetT) *ReplicaSourceInfo { 1049 x := &ReplicaSourceInfo{} 1050 InitReplicaSourceInfoRoot(x, buf, offset+flatbuffers.SizeUint32) 1051 return x 1052 } 1053 1054 func (rcv *ReplicaSourceInfo) Init(buf []byte, i flatbuffers.UOffsetT) { 1055 rcv._tab.Bytes = buf 1056 rcv._tab.Pos = i 1057 } 1058 1059 func (rcv *ReplicaSourceInfo) Table() flatbuffers.Table { 1060 return rcv._tab 1061 } 1062 1063 func (rcv *ReplicaSourceInfo) Host() []byte { 1064 o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) 1065 if o != 0 { 1066 return rcv._tab.ByteVector(o + rcv._tab.Pos) 1067 } 1068 return nil 1069 } 1070 1071 func (rcv *ReplicaSourceInfo) User() []byte { 1072 o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) 1073 if o != 0 { 1074 return rcv._tab.ByteVector(o + rcv._tab.Pos) 1075 } 1076 return nil 1077 } 1078 1079 func (rcv *ReplicaSourceInfo) Password() []byte { 1080 o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) 1081 if o != 0 { 1082 return rcv._tab.ByteVector(o + rcv._tab.Pos) 1083 } 1084 return nil 1085 } 1086 1087 func (rcv *ReplicaSourceInfo) Port() uint16 { 1088 o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) 1089 if o != 0 { 1090 return rcv._tab.GetUint16(o + rcv._tab.Pos) 1091 } 1092 return 0 1093 } 1094 1095 func (rcv *ReplicaSourceInfo) MutatePort(n uint16) bool { 1096 return rcv._tab.MutateUint16Slot(10, n) 1097 } 1098 1099 func (rcv *ReplicaSourceInfo) Uuid() []byte { 1100 o := flatbuffers.UOffsetT(rcv._tab.Offset(12)) 1101 if o != 0 { 1102 return rcv._tab.ByteVector(o + rcv._tab.Pos) 1103 } 1104 return nil 1105 } 1106 1107 func (rcv *ReplicaSourceInfo) ConnectRetryInterval() uint32 { 1108 o := flatbuffers.UOffsetT(rcv._tab.Offset(14)) 1109 if o != 0 { 1110 return rcv._tab.GetUint32(o + rcv._tab.Pos) 1111 } 1112 return 0 1113 } 1114 1115 func (rcv *ReplicaSourceInfo) MutateConnectRetryInterval(n uint32) bool { 1116 return rcv._tab.MutateUint32Slot(14, n) 1117 } 1118 1119 func (rcv *ReplicaSourceInfo) ConnectRetryCount() uint64 { 1120 o := flatbuffers.UOffsetT(rcv._tab.Offset(16)) 1121 if o != 0 { 1122 return rcv._tab.GetUint64(o + rcv._tab.Pos) 1123 } 1124 return 0 1125 } 1126 1127 func (rcv *ReplicaSourceInfo) MutateConnectRetryCount(n uint64) bool { 1128 return rcv._tab.MutateUint64Slot(16, n) 1129 } 1130 1131 const ReplicaSourceInfoNumFields = 7 1132 1133 func ReplicaSourceInfoStart(builder *flatbuffers.Builder) { 1134 builder.StartObject(ReplicaSourceInfoNumFields) 1135 } 1136 func ReplicaSourceInfoAddHost(builder *flatbuffers.Builder, host flatbuffers.UOffsetT) { 1137 builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(host), 0) 1138 } 1139 func ReplicaSourceInfoAddUser(builder *flatbuffers.Builder, user flatbuffers.UOffsetT) { 1140 builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(user), 0) 1141 } 1142 func ReplicaSourceInfoAddPassword(builder *flatbuffers.Builder, password flatbuffers.UOffsetT) { 1143 builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(password), 0) 1144 } 1145 func ReplicaSourceInfoAddPort(builder *flatbuffers.Builder, port uint16) { 1146 builder.PrependUint16Slot(3, port, 0) 1147 } 1148 func ReplicaSourceInfoAddUuid(builder *flatbuffers.Builder, uuid flatbuffers.UOffsetT) { 1149 builder.PrependUOffsetTSlot(4, flatbuffers.UOffsetT(uuid), 0) 1150 } 1151 func ReplicaSourceInfoAddConnectRetryInterval(builder *flatbuffers.Builder, connectRetryInterval uint32) { 1152 builder.PrependUint32Slot(5, connectRetryInterval, 0) 1153 } 1154 func ReplicaSourceInfoAddConnectRetryCount(builder *flatbuffers.Builder, connectRetryCount uint64) { 1155 builder.PrependUint64Slot(6, connectRetryCount, 0) 1156 } 1157 func ReplicaSourceInfoEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { 1158 return builder.EndObject() 1159 } 1160 1161 type MySQLDb struct { 1162 _tab flatbuffers.Table 1163 } 1164 1165 func InitMySQLDbRoot(o *MySQLDb, buf []byte, offset flatbuffers.UOffsetT) error { 1166 n := flatbuffers.GetUOffsetT(buf[offset:]) 1167 o.Init(buf, n+offset) 1168 if MySQLDbNumFields < o.Table().NumFields() { 1169 return flatbuffers.ErrTableHasUnknownFields 1170 } 1171 return nil 1172 } 1173 1174 func TryGetRootAsMySQLDb(buf []byte, offset flatbuffers.UOffsetT) (*MySQLDb, error) { 1175 x := &MySQLDb{} 1176 return x, InitMySQLDbRoot(x, buf, offset) 1177 } 1178 1179 func GetRootAsMySQLDb(buf []byte, offset flatbuffers.UOffsetT) *MySQLDb { 1180 x := &MySQLDb{} 1181 InitMySQLDbRoot(x, buf, offset) 1182 return x 1183 } 1184 1185 func TryGetSizePrefixedRootAsMySQLDb(buf []byte, offset flatbuffers.UOffsetT) (*MySQLDb, error) { 1186 x := &MySQLDb{} 1187 return x, InitMySQLDbRoot(x, buf, offset+flatbuffers.SizeUint32) 1188 } 1189 1190 func GetSizePrefixedRootAsMySQLDb(buf []byte, offset flatbuffers.UOffsetT) *MySQLDb { 1191 x := &MySQLDb{} 1192 InitMySQLDbRoot(x, buf, offset+flatbuffers.SizeUint32) 1193 return x 1194 } 1195 1196 func (rcv *MySQLDb) Init(buf []byte, i flatbuffers.UOffsetT) { 1197 rcv._tab.Bytes = buf 1198 rcv._tab.Pos = i 1199 } 1200 1201 func (rcv *MySQLDb) Table() flatbuffers.Table { 1202 return rcv._tab 1203 } 1204 1205 func (rcv *MySQLDb) User(obj *User, j int) bool { 1206 o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) 1207 if o != 0 { 1208 x := rcv._tab.Vector(o) 1209 x += flatbuffers.UOffsetT(j) * 4 1210 x = rcv._tab.Indirect(x) 1211 obj.Init(rcv._tab.Bytes, x) 1212 return true 1213 } 1214 return false 1215 } 1216 1217 func (rcv *MySQLDb) TryUser(obj *User, j int) (bool, error) { 1218 o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) 1219 if o != 0 { 1220 x := rcv._tab.Vector(o) 1221 x += flatbuffers.UOffsetT(j) * 4 1222 x = rcv._tab.Indirect(x) 1223 obj.Init(rcv._tab.Bytes, x) 1224 if UserNumFields < obj.Table().NumFields() { 1225 return false, flatbuffers.ErrTableHasUnknownFields 1226 } 1227 return true, nil 1228 } 1229 return false, nil 1230 } 1231 1232 func (rcv *MySQLDb) UserLength() int { 1233 o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) 1234 if o != 0 { 1235 return rcv._tab.VectorLen(o) 1236 } 1237 return 0 1238 } 1239 1240 func (rcv *MySQLDb) RoleEdges(obj *RoleEdge, j int) bool { 1241 o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) 1242 if o != 0 { 1243 x := rcv._tab.Vector(o) 1244 x += flatbuffers.UOffsetT(j) * 4 1245 x = rcv._tab.Indirect(x) 1246 obj.Init(rcv._tab.Bytes, x) 1247 return true 1248 } 1249 return false 1250 } 1251 1252 func (rcv *MySQLDb) TryRoleEdges(obj *RoleEdge, j int) (bool, error) { 1253 o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) 1254 if o != 0 { 1255 x := rcv._tab.Vector(o) 1256 x += flatbuffers.UOffsetT(j) * 4 1257 x = rcv._tab.Indirect(x) 1258 obj.Init(rcv._tab.Bytes, x) 1259 if RoleEdgeNumFields < obj.Table().NumFields() { 1260 return false, flatbuffers.ErrTableHasUnknownFields 1261 } 1262 return true, nil 1263 } 1264 return false, nil 1265 } 1266 1267 func (rcv *MySQLDb) RoleEdgesLength() int { 1268 o := flatbuffers.UOffsetT(rcv._tab.Offset(6)) 1269 if o != 0 { 1270 return rcv._tab.VectorLen(o) 1271 } 1272 return 0 1273 } 1274 1275 func (rcv *MySQLDb) ReplicaSourceInfo(obj *ReplicaSourceInfo, j int) bool { 1276 o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) 1277 if o != 0 { 1278 x := rcv._tab.Vector(o) 1279 x += flatbuffers.UOffsetT(j) * 4 1280 x = rcv._tab.Indirect(x) 1281 obj.Init(rcv._tab.Bytes, x) 1282 return true 1283 } 1284 return false 1285 } 1286 1287 func (rcv *MySQLDb) TryReplicaSourceInfo(obj *ReplicaSourceInfo, j int) (bool, error) { 1288 o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) 1289 if o != 0 { 1290 x := rcv._tab.Vector(o) 1291 x += flatbuffers.UOffsetT(j) * 4 1292 x = rcv._tab.Indirect(x) 1293 obj.Init(rcv._tab.Bytes, x) 1294 if ReplicaSourceInfoNumFields < obj.Table().NumFields() { 1295 return false, flatbuffers.ErrTableHasUnknownFields 1296 } 1297 return true, nil 1298 } 1299 return false, nil 1300 } 1301 1302 func (rcv *MySQLDb) ReplicaSourceInfoLength() int { 1303 o := flatbuffers.UOffsetT(rcv._tab.Offset(8)) 1304 if o != 0 { 1305 return rcv._tab.VectorLen(o) 1306 } 1307 return 0 1308 } 1309 1310 func (rcv *MySQLDb) SuperUser(obj *User, j int) bool { 1311 o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) 1312 if o != 0 { 1313 x := rcv._tab.Vector(o) 1314 x += flatbuffers.UOffsetT(j) * 4 1315 x = rcv._tab.Indirect(x) 1316 obj.Init(rcv._tab.Bytes, x) 1317 return true 1318 } 1319 return false 1320 } 1321 1322 func (rcv *MySQLDb) TrySuperUser(obj *User, j int) (bool, error) { 1323 o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) 1324 if o != 0 { 1325 x := rcv._tab.Vector(o) 1326 x += flatbuffers.UOffsetT(j) * 4 1327 x = rcv._tab.Indirect(x) 1328 obj.Init(rcv._tab.Bytes, x) 1329 if UserNumFields < obj.Table().NumFields() { 1330 return false, flatbuffers.ErrTableHasUnknownFields 1331 } 1332 return true, nil 1333 } 1334 return false, nil 1335 } 1336 1337 func (rcv *MySQLDb) SuperUserLength() int { 1338 o := flatbuffers.UOffsetT(rcv._tab.Offset(10)) 1339 if o != 0 { 1340 return rcv._tab.VectorLen(o) 1341 } 1342 return 0 1343 } 1344 1345 const MySQLDbNumFields = 4 1346 1347 func MySQLDbStart(builder *flatbuffers.Builder) { 1348 builder.StartObject(MySQLDbNumFields) 1349 } 1350 func MySQLDbAddUser(builder *flatbuffers.Builder, user flatbuffers.UOffsetT) { 1351 builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(user), 0) 1352 } 1353 func MySQLDbStartUserVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { 1354 return builder.StartVector(4, numElems, 4) 1355 } 1356 func MySQLDbAddRoleEdges(builder *flatbuffers.Builder, roleEdges flatbuffers.UOffsetT) { 1357 builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(roleEdges), 0) 1358 } 1359 func MySQLDbStartRoleEdgesVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { 1360 return builder.StartVector(4, numElems, 4) 1361 } 1362 func MySQLDbAddReplicaSourceInfo(builder *flatbuffers.Builder, replicaSourceInfo flatbuffers.UOffsetT) { 1363 builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(replicaSourceInfo), 0) 1364 } 1365 func MySQLDbStartReplicaSourceInfoVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { 1366 return builder.StartVector(4, numElems, 4) 1367 } 1368 func MySQLDbAddSuperUser(builder *flatbuffers.Builder, superUser flatbuffers.UOffsetT) { 1369 builder.PrependUOffsetTSlot(3, flatbuffers.UOffsetT(superUser), 0) 1370 } 1371 func MySQLDbStartSuperUserVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { 1372 return builder.StartVector(4, numElems, 4) 1373 } 1374 func MySQLDbEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { 1375 return builder.EndObject() 1376 }