github.com/fibonacci-chain/fbc@v0.0.0-20231124064014-c7636198c1e9/libs/cosmos-sdk/types/query/pagination.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: cosmos/base/query/v1beta1/pagination.proto 3 4 package query 5 6 import ( 7 fmt "fmt" 8 proto "github.com/gogo/protobuf/proto" 9 io "io" 10 math "math" 11 math_bits "math/bits" 12 ) 13 14 // Reference imports to suppress errors if they are not otherwise used. 15 var _ = proto.Marshal 16 var _ = fmt.Errorf 17 var _ = math.Inf 18 19 // This is a compile-time assertion to ensure that this generated file 20 // is compatible with the proto package it is being compiled against. 21 // A compilation error at this line likely means your copy of the 22 // proto package needs to be updated. 23 const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package 24 25 // PageRequest is to be embedded in gRPC request messages for efficient 26 // pagination. Ex: 27 // 28 // message SomeRequest { 29 // Foo some_parameter = 1; 30 // PageRequest pagination = 2; 31 // } 32 type PageRequest struct { 33 // key is a value returned in PageResponse.next_key to begin 34 // querying the next page most efficiently. Only one of offset or key 35 // should be set. 36 Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` 37 // offset is a numeric offset that can be used when key is unavailable. 38 // It is less efficient than using key. Only one of offset or key should 39 // be set. 40 Offset uint64 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` 41 // limit is the total number of results to be returned in the result page. 42 // If left empty it will default to a value to be set by each app. 43 Limit uint64 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"` 44 // count_total is set to true to indicate that the result set should include 45 // a count of the total number of items available for pagination in UIs. 46 // count_total is only respected when offset is used. It is ignored when key 47 // is set. 48 CountTotal bool `protobuf:"varint,4,opt,name=count_total,json=countTotal,proto3" json:"count_total,omitempty"` 49 } 50 51 func (m *PageRequest) Reset() { *m = PageRequest{} } 52 func (m *PageRequest) String() string { return proto.CompactTextString(m) } 53 func (*PageRequest) ProtoMessage() {} 54 func (*PageRequest) Descriptor() ([]byte, []int) { 55 return fileDescriptor_53d6d609fe6828af, []int{0} 56 } 57 func (m *PageRequest) XXX_Unmarshal(b []byte) error { 58 return m.Unmarshal(b) 59 } 60 func (m *PageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 61 if deterministic { 62 return xxx_messageInfo_PageRequest.Marshal(b, m, deterministic) 63 } else { 64 b = b[:cap(b)] 65 n, err := m.MarshalToSizedBuffer(b) 66 if err != nil { 67 return nil, err 68 } 69 return b[:n], nil 70 } 71 } 72 func (m *PageRequest) XXX_Merge(src proto.Message) { 73 xxx_messageInfo_PageRequest.Merge(m, src) 74 } 75 func (m *PageRequest) XXX_Size() int { 76 return m.Size() 77 } 78 func (m *PageRequest) XXX_DiscardUnknown() { 79 xxx_messageInfo_PageRequest.DiscardUnknown(m) 80 } 81 82 var xxx_messageInfo_PageRequest proto.InternalMessageInfo 83 84 func (m *PageRequest) GetKey() []byte { 85 if m != nil { 86 return m.Key 87 } 88 return nil 89 } 90 91 func (m *PageRequest) GetOffset() uint64 { 92 if m != nil { 93 return m.Offset 94 } 95 return 0 96 } 97 98 func (m *PageRequest) GetLimit() uint64 { 99 if m != nil { 100 return m.Limit 101 } 102 return 0 103 } 104 105 func (m *PageRequest) GetCountTotal() bool { 106 if m != nil { 107 return m.CountTotal 108 } 109 return false 110 } 111 112 // PageResponse is to be embedded in gRPC response messages where the 113 // corresponding request message has used PageRequest. 114 // 115 // message SomeResponse { 116 // repeated Bar results = 1; 117 // PageResponse page = 2; 118 // } 119 type PageResponse struct { 120 // next_key is the key to be passed to PageRequest.key to 121 // query the next page most efficiently 122 NextKey []byte `protobuf:"bytes,1,opt,name=next_key,json=nextKey,proto3" json:"next_key,omitempty"` 123 // total is total number of results available if PageRequest.count_total 124 // was set, its value is undefined otherwise 125 Total uint64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` 126 } 127 128 func (m *PageResponse) Reset() { *m = PageResponse{} } 129 func (m *PageResponse) String() string { return proto.CompactTextString(m) } 130 func (*PageResponse) ProtoMessage() {} 131 func (*PageResponse) Descriptor() ([]byte, []int) { 132 return fileDescriptor_53d6d609fe6828af, []int{1} 133 } 134 func (m *PageResponse) XXX_Unmarshal(b []byte) error { 135 return m.Unmarshal(b) 136 } 137 func (m *PageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 138 if deterministic { 139 return xxx_messageInfo_PageResponse.Marshal(b, m, deterministic) 140 } else { 141 b = b[:cap(b)] 142 n, err := m.MarshalToSizedBuffer(b) 143 if err != nil { 144 return nil, err 145 } 146 return b[:n], nil 147 } 148 } 149 func (m *PageResponse) XXX_Merge(src proto.Message) { 150 xxx_messageInfo_PageResponse.Merge(m, src) 151 } 152 func (m *PageResponse) XXX_Size() int { 153 return m.Size() 154 } 155 func (m *PageResponse) XXX_DiscardUnknown() { 156 xxx_messageInfo_PageResponse.DiscardUnknown(m) 157 } 158 159 var xxx_messageInfo_PageResponse proto.InternalMessageInfo 160 161 func (m *PageResponse) GetNextKey() []byte { 162 if m != nil { 163 return m.NextKey 164 } 165 return nil 166 } 167 168 func (m *PageResponse) GetTotal() uint64 { 169 if m != nil { 170 return m.Total 171 } 172 return 0 173 } 174 175 func init() { 176 proto.RegisterType((*PageRequest)(nil), "cosmos.base.query.v1beta1.PageRequest") 177 proto.RegisterType((*PageResponse)(nil), "cosmos.base.query.v1beta1.PageResponse") 178 } 179 180 func init() { 181 proto.RegisterFile("cosmos/base/query/v1beta1/pagination.proto", fileDescriptor_53d6d609fe6828af) 182 } 183 184 var fileDescriptor_53d6d609fe6828af = []byte{ 185 // 266 bytes of a gzipped FileDescriptorProto 186 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x44, 0x90, 0xc1, 0x4a, 0xc3, 0x40, 187 0x14, 0x45, 0x33, 0xb6, 0xd6, 0x32, 0xed, 0x42, 0x06, 0x91, 0x74, 0x33, 0x86, 0xae, 0x82, 0x60, 188 0x86, 0xe2, 0x07, 0x08, 0xdd, 0xba, 0x91, 0xe0, 0xca, 0x4d, 0x99, 0xc4, 0xd7, 0x18, 0xda, 0xcc, 189 0x4b, 0x3b, 0x2f, 0x62, 0xfe, 0xc2, 0xcf, 0x72, 0xd9, 0xa5, 0x4b, 0x49, 0x7e, 0x44, 0x92, 0x09, 190 0x74, 0x35, 0x73, 0x2f, 0x87, 0x77, 0xe0, 0xf2, 0xfb, 0x14, 0x6d, 0x81, 0x56, 0x25, 0xda, 0x82, 191 0x3a, 0x54, 0x70, 0xac, 0xd5, 0xe7, 0x2a, 0x01, 0xd2, 0x2b, 0x55, 0xea, 0x2c, 0x37, 0x9a, 0x72, 192 0x34, 0x51, 0x79, 0x44, 0x42, 0xb1, 0x70, 0x6c, 0xd4, 0xb1, 0x51, 0xcf, 0x46, 0x03, 0xbb, 0x34, 193 0x7c, 0xf6, 0xa2, 0x33, 0x88, 0xe1, 0x50, 0x81, 0x25, 0x71, 0xcd, 0x47, 0x3b, 0xa8, 0x7d, 0x16, 194 0xb0, 0x70, 0x1e, 0x77, 0x5f, 0x71, 0xcb, 0x27, 0xb8, 0xdd, 0x5a, 0x20, 0xff, 0x22, 0x60, 0xe1, 195 0x38, 0x1e, 0x92, 0xb8, 0xe1, 0x97, 0xfb, 0xbc, 0xc8, 0xc9, 0x1f, 0xf5, 0xb5, 0x0b, 0xe2, 0x8e, 196 0xcf, 0x52, 0xac, 0x0c, 0x6d, 0x08, 0x49, 0xef, 0xfd, 0x71, 0xc0, 0xc2, 0x69, 0xcc, 0xfb, 0xea, 197 0xb5, 0x6b, 0x96, 0x4f, 0x7c, 0xee, 0x7c, 0xb6, 0x44, 0x63, 0x41, 0x2c, 0xf8, 0xd4, 0xc0, 0x17, 198 0x6d, 0xce, 0xd6, 0xab, 0x2e, 0x3f, 0x43, 0xdd, 0x19, 0xdc, 0x15, 0x27, 0x76, 0x61, 0xbd, 0xfe, 199 0x69, 0x24, 0x3b, 0x35, 0x92, 0xfd, 0x35, 0x92, 0x7d, 0xb7, 0xd2, 0x3b, 0xb5, 0xd2, 0xfb, 0x6d, 200 0xa5, 0xf7, 0x16, 0x66, 0x39, 0x7d, 0x54, 0x49, 0x94, 0x62, 0xa1, 0x86, 0x71, 0xdc, 0xf3, 0x60, 201 0xdf, 0x77, 0x8a, 0xea, 0x12, 0xac, 0x1b, 0x2a, 0x99, 0xf4, 0xb3, 0x3c, 0xfe, 0x07, 0x00, 0x00, 202 0xff, 0xff, 0xb5, 0x65, 0x82, 0x18, 0x44, 0x01, 0x00, 0x00, 203 } 204 205 func (m *PageRequest) Marshal() (dAtA []byte, err error) { 206 size := m.Size() 207 dAtA = make([]byte, size) 208 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 209 if err != nil { 210 return nil, err 211 } 212 return dAtA[:n], nil 213 } 214 215 func (m *PageRequest) MarshalTo(dAtA []byte) (int, error) { 216 size := m.Size() 217 return m.MarshalToSizedBuffer(dAtA[:size]) 218 } 219 220 func (m *PageRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { 221 i := len(dAtA) 222 _ = i 223 var l int 224 _ = l 225 if m.CountTotal { 226 i-- 227 if m.CountTotal { 228 dAtA[i] = 1 229 } else { 230 dAtA[i] = 0 231 } 232 i-- 233 dAtA[i] = 0x20 234 } 235 if m.Limit != 0 { 236 i = encodeVarintPagination(dAtA, i, uint64(m.Limit)) 237 i-- 238 dAtA[i] = 0x18 239 } 240 if m.Offset != 0 { 241 i = encodeVarintPagination(dAtA, i, uint64(m.Offset)) 242 i-- 243 dAtA[i] = 0x10 244 } 245 if len(m.Key) > 0 { 246 i -= len(m.Key) 247 copy(dAtA[i:], m.Key) 248 i = encodeVarintPagination(dAtA, i, uint64(len(m.Key))) 249 i-- 250 dAtA[i] = 0xa 251 } 252 return len(dAtA) - i, nil 253 } 254 255 func (m *PageResponse) Marshal() (dAtA []byte, err error) { 256 size := m.Size() 257 dAtA = make([]byte, size) 258 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 259 if err != nil { 260 return nil, err 261 } 262 return dAtA[:n], nil 263 } 264 265 func (m *PageResponse) MarshalTo(dAtA []byte) (int, error) { 266 size := m.Size() 267 return m.MarshalToSizedBuffer(dAtA[:size]) 268 } 269 270 func (m *PageResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { 271 i := len(dAtA) 272 _ = i 273 var l int 274 _ = l 275 if m.Total != 0 { 276 i = encodeVarintPagination(dAtA, i, uint64(m.Total)) 277 i-- 278 dAtA[i] = 0x10 279 } 280 if len(m.NextKey) > 0 { 281 i -= len(m.NextKey) 282 copy(dAtA[i:], m.NextKey) 283 i = encodeVarintPagination(dAtA, i, uint64(len(m.NextKey))) 284 i-- 285 dAtA[i] = 0xa 286 } 287 return len(dAtA) - i, nil 288 } 289 290 func encodeVarintPagination(dAtA []byte, offset int, v uint64) int { 291 offset -= sovPagination(v) 292 base := offset 293 for v >= 1<<7 { 294 dAtA[offset] = uint8(v&0x7f | 0x80) 295 v >>= 7 296 offset++ 297 } 298 dAtA[offset] = uint8(v) 299 return base 300 } 301 func (m *PageRequest) Size() (n int) { 302 if m == nil { 303 return 0 304 } 305 var l int 306 _ = l 307 l = len(m.Key) 308 if l > 0 { 309 n += 1 + l + sovPagination(uint64(l)) 310 } 311 if m.Offset != 0 { 312 n += 1 + sovPagination(uint64(m.Offset)) 313 } 314 if m.Limit != 0 { 315 n += 1 + sovPagination(uint64(m.Limit)) 316 } 317 if m.CountTotal { 318 n += 2 319 } 320 return n 321 } 322 323 func (m *PageResponse) Size() (n int) { 324 if m == nil { 325 return 0 326 } 327 var l int 328 _ = l 329 l = len(m.NextKey) 330 if l > 0 { 331 n += 1 + l + sovPagination(uint64(l)) 332 } 333 if m.Total != 0 { 334 n += 1 + sovPagination(uint64(m.Total)) 335 } 336 return n 337 } 338 339 func sovPagination(x uint64) (n int) { 340 return (math_bits.Len64(x|1) + 6) / 7 341 } 342 func sozPagination(x uint64) (n int) { 343 return sovPagination(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 344 } 345 func (m *PageRequest) Unmarshal(dAtA []byte) error { 346 l := len(dAtA) 347 iNdEx := 0 348 for iNdEx < l { 349 preIndex := iNdEx 350 var wire uint64 351 for shift := uint(0); ; shift += 7 { 352 if shift >= 64 { 353 return ErrIntOverflowPagination 354 } 355 if iNdEx >= l { 356 return io.ErrUnexpectedEOF 357 } 358 b := dAtA[iNdEx] 359 iNdEx++ 360 wire |= uint64(b&0x7F) << shift 361 if b < 0x80 { 362 break 363 } 364 } 365 fieldNum := int32(wire >> 3) 366 wireType := int(wire & 0x7) 367 if wireType == 4 { 368 return fmt.Errorf("proto: PageRequest: wiretype end group for non-group") 369 } 370 if fieldNum <= 0 { 371 return fmt.Errorf("proto: PageRequest: illegal tag %d (wire type %d)", fieldNum, wire) 372 } 373 switch fieldNum { 374 case 1: 375 if wireType != 2 { 376 return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) 377 } 378 var byteLen int 379 for shift := uint(0); ; shift += 7 { 380 if shift >= 64 { 381 return ErrIntOverflowPagination 382 } 383 if iNdEx >= l { 384 return io.ErrUnexpectedEOF 385 } 386 b := dAtA[iNdEx] 387 iNdEx++ 388 byteLen |= int(b&0x7F) << shift 389 if b < 0x80 { 390 break 391 } 392 } 393 if byteLen < 0 { 394 return ErrInvalidLengthPagination 395 } 396 postIndex := iNdEx + byteLen 397 if postIndex < 0 { 398 return ErrInvalidLengthPagination 399 } 400 if postIndex > l { 401 return io.ErrUnexpectedEOF 402 } 403 m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) 404 if m.Key == nil { 405 m.Key = []byte{} 406 } 407 iNdEx = postIndex 408 case 2: 409 if wireType != 0 { 410 return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType) 411 } 412 m.Offset = 0 413 for shift := uint(0); ; shift += 7 { 414 if shift >= 64 { 415 return ErrIntOverflowPagination 416 } 417 if iNdEx >= l { 418 return io.ErrUnexpectedEOF 419 } 420 b := dAtA[iNdEx] 421 iNdEx++ 422 m.Offset |= uint64(b&0x7F) << shift 423 if b < 0x80 { 424 break 425 } 426 } 427 case 3: 428 if wireType != 0 { 429 return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) 430 } 431 m.Limit = 0 432 for shift := uint(0); ; shift += 7 { 433 if shift >= 64 { 434 return ErrIntOverflowPagination 435 } 436 if iNdEx >= l { 437 return io.ErrUnexpectedEOF 438 } 439 b := dAtA[iNdEx] 440 iNdEx++ 441 m.Limit |= uint64(b&0x7F) << shift 442 if b < 0x80 { 443 break 444 } 445 } 446 case 4: 447 if wireType != 0 { 448 return fmt.Errorf("proto: wrong wireType = %d for field CountTotal", wireType) 449 } 450 var v int 451 for shift := uint(0); ; shift += 7 { 452 if shift >= 64 { 453 return ErrIntOverflowPagination 454 } 455 if iNdEx >= l { 456 return io.ErrUnexpectedEOF 457 } 458 b := dAtA[iNdEx] 459 iNdEx++ 460 v |= int(b&0x7F) << shift 461 if b < 0x80 { 462 break 463 } 464 } 465 m.CountTotal = bool(v != 0) 466 default: 467 iNdEx = preIndex 468 skippy, err := skipPagination(dAtA[iNdEx:]) 469 if err != nil { 470 return err 471 } 472 if (skippy < 0) || (iNdEx+skippy) < 0 { 473 return ErrInvalidLengthPagination 474 } 475 if (iNdEx + skippy) > l { 476 return io.ErrUnexpectedEOF 477 } 478 iNdEx += skippy 479 } 480 } 481 482 if iNdEx > l { 483 return io.ErrUnexpectedEOF 484 } 485 return nil 486 } 487 func (m *PageResponse) Unmarshal(dAtA []byte) error { 488 l := len(dAtA) 489 iNdEx := 0 490 for iNdEx < l { 491 preIndex := iNdEx 492 var wire uint64 493 for shift := uint(0); ; shift += 7 { 494 if shift >= 64 { 495 return ErrIntOverflowPagination 496 } 497 if iNdEx >= l { 498 return io.ErrUnexpectedEOF 499 } 500 b := dAtA[iNdEx] 501 iNdEx++ 502 wire |= uint64(b&0x7F) << shift 503 if b < 0x80 { 504 break 505 } 506 } 507 fieldNum := int32(wire >> 3) 508 wireType := int(wire & 0x7) 509 if wireType == 4 { 510 return fmt.Errorf("proto: PageResponse: wiretype end group for non-group") 511 } 512 if fieldNum <= 0 { 513 return fmt.Errorf("proto: PageResponse: illegal tag %d (wire type %d)", fieldNum, wire) 514 } 515 switch fieldNum { 516 case 1: 517 if wireType != 2 { 518 return fmt.Errorf("proto: wrong wireType = %d for field NextKey", wireType) 519 } 520 var byteLen int 521 for shift := uint(0); ; shift += 7 { 522 if shift >= 64 { 523 return ErrIntOverflowPagination 524 } 525 if iNdEx >= l { 526 return io.ErrUnexpectedEOF 527 } 528 b := dAtA[iNdEx] 529 iNdEx++ 530 byteLen |= int(b&0x7F) << shift 531 if b < 0x80 { 532 break 533 } 534 } 535 if byteLen < 0 { 536 return ErrInvalidLengthPagination 537 } 538 postIndex := iNdEx + byteLen 539 if postIndex < 0 { 540 return ErrInvalidLengthPagination 541 } 542 if postIndex > l { 543 return io.ErrUnexpectedEOF 544 } 545 m.NextKey = append(m.NextKey[:0], dAtA[iNdEx:postIndex]...) 546 if m.NextKey == nil { 547 m.NextKey = []byte{} 548 } 549 iNdEx = postIndex 550 case 2: 551 if wireType != 0 { 552 return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType) 553 } 554 m.Total = 0 555 for shift := uint(0); ; shift += 7 { 556 if shift >= 64 { 557 return ErrIntOverflowPagination 558 } 559 if iNdEx >= l { 560 return io.ErrUnexpectedEOF 561 } 562 b := dAtA[iNdEx] 563 iNdEx++ 564 m.Total |= uint64(b&0x7F) << shift 565 if b < 0x80 { 566 break 567 } 568 } 569 default: 570 iNdEx = preIndex 571 skippy, err := skipPagination(dAtA[iNdEx:]) 572 if err != nil { 573 return err 574 } 575 if (skippy < 0) || (iNdEx+skippy) < 0 { 576 return ErrInvalidLengthPagination 577 } 578 if (iNdEx + skippy) > l { 579 return io.ErrUnexpectedEOF 580 } 581 iNdEx += skippy 582 } 583 } 584 585 if iNdEx > l { 586 return io.ErrUnexpectedEOF 587 } 588 return nil 589 } 590 func skipPagination(dAtA []byte) (n int, err error) { 591 l := len(dAtA) 592 iNdEx := 0 593 depth := 0 594 for iNdEx < l { 595 var wire uint64 596 for shift := uint(0); ; shift += 7 { 597 if shift >= 64 { 598 return 0, ErrIntOverflowPagination 599 } 600 if iNdEx >= l { 601 return 0, io.ErrUnexpectedEOF 602 } 603 b := dAtA[iNdEx] 604 iNdEx++ 605 wire |= (uint64(b) & 0x7F) << shift 606 if b < 0x80 { 607 break 608 } 609 } 610 wireType := int(wire & 0x7) 611 switch wireType { 612 case 0: 613 for shift := uint(0); ; shift += 7 { 614 if shift >= 64 { 615 return 0, ErrIntOverflowPagination 616 } 617 if iNdEx >= l { 618 return 0, io.ErrUnexpectedEOF 619 } 620 iNdEx++ 621 if dAtA[iNdEx-1] < 0x80 { 622 break 623 } 624 } 625 case 1: 626 iNdEx += 8 627 case 2: 628 var length int 629 for shift := uint(0); ; shift += 7 { 630 if shift >= 64 { 631 return 0, ErrIntOverflowPagination 632 } 633 if iNdEx >= l { 634 return 0, io.ErrUnexpectedEOF 635 } 636 b := dAtA[iNdEx] 637 iNdEx++ 638 length |= (int(b) & 0x7F) << shift 639 if b < 0x80 { 640 break 641 } 642 } 643 if length < 0 { 644 return 0, ErrInvalidLengthPagination 645 } 646 iNdEx += length 647 case 3: 648 depth++ 649 case 4: 650 if depth == 0 { 651 return 0, ErrUnexpectedEndOfGroupPagination 652 } 653 depth-- 654 case 5: 655 iNdEx += 4 656 default: 657 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 658 } 659 if iNdEx < 0 { 660 return 0, ErrInvalidLengthPagination 661 } 662 if depth == 0 { 663 return iNdEx, nil 664 } 665 } 666 return 0, io.ErrUnexpectedEOF 667 } 668 669 var ( 670 ErrInvalidLengthPagination = fmt.Errorf("proto: negative length found during unmarshaling") 671 ErrIntOverflowPagination = fmt.Errorf("proto: integer overflow") 672 ErrUnexpectedEndOfGroupPagination = fmt.Errorf("proto: unexpected end of group") 673 )