github.com/pingcap/badger@v1.5.1-0.20230103063557-828f39b09b6d/protos/brkv.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: brkv.proto 3 4 package protos 5 6 import ( 7 fmt "fmt" 8 proto "github.com/golang/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.ProtoPackageIsVersion3 // please upgrade the proto package 24 25 type KVPair struct { 26 Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` 27 Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` 28 UserMeta []byte `protobuf:"bytes,3,opt,name=userMeta,proto3" json:"userMeta,omitempty"` 29 Version uint64 `protobuf:"varint,4,opt,name=version,proto3" json:"version,omitempty"` 30 XXX_NoUnkeyedLiteral struct{} `json:"-"` 31 XXX_unrecognized []byte `json:"-"` 32 XXX_sizecache int32 `json:"-"` 33 } 34 35 func (m *KVPair) Reset() { *m = KVPair{} } 36 func (m *KVPair) String() string { return proto.CompactTextString(m) } 37 func (*KVPair) ProtoMessage() {} 38 func (*KVPair) Descriptor() ([]byte, []int) { 39 return fileDescriptor_65240d19de191688, []int{0} 40 } 41 func (m *KVPair) XXX_Unmarshal(b []byte) error { 42 return m.Unmarshal(b) 43 } 44 func (m *KVPair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 45 if deterministic { 46 return xxx_messageInfo_KVPair.Marshal(b, m, deterministic) 47 } else { 48 b = b[:cap(b)] 49 n, err := m.MarshalToSizedBuffer(b) 50 if err != nil { 51 return nil, err 52 } 53 return b[:n], nil 54 } 55 } 56 func (m *KVPair) XXX_Merge(src proto.Message) { 57 xxx_messageInfo_KVPair.Merge(m, src) 58 } 59 func (m *KVPair) XXX_Size() int { 60 return m.Size() 61 } 62 func (m *KVPair) XXX_DiscardUnknown() { 63 xxx_messageInfo_KVPair.DiscardUnknown(m) 64 } 65 66 var xxx_messageInfo_KVPair proto.InternalMessageInfo 67 68 func (m *KVPair) GetKey() []byte { 69 if m != nil { 70 return m.Key 71 } 72 return nil 73 } 74 75 func (m *KVPair) GetValue() []byte { 76 if m != nil { 77 return m.Value 78 } 79 return nil 80 } 81 82 func (m *KVPair) GetUserMeta() []byte { 83 if m != nil { 84 return m.UserMeta 85 } 86 return nil 87 } 88 89 func (m *KVPair) GetVersion() uint64 { 90 if m != nil { 91 return m.Version 92 } 93 return 0 94 } 95 96 func init() { 97 proto.RegisterType((*KVPair)(nil), "protos.KVPair") 98 } 99 100 func init() { proto.RegisterFile("brkv.proto", fileDescriptor_65240d19de191688) } 101 102 var fileDescriptor_65240d19de191688 = []byte{ 103 // 144 bytes of a gzipped FileDescriptorProto 104 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x49, 0x4a, 0x4c, 0xce, 105 0x2e, 0x2d, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x03, 0x53, 0xc5, 0x4a, 0x69, 0x5c, 106 0x6c, 0xde, 0x61, 0x01, 0x89, 0x99, 0x45, 0x42, 0x02, 0x5c, 0xcc, 0xd9, 0xa9, 0x95, 0x12, 0x8c, 107 0x0a, 0x8c, 0x1a, 0x3c, 0x41, 0x20, 0xa6, 0x90, 0x08, 0x17, 0x6b, 0x59, 0x62, 0x4e, 0x69, 0xaa, 108 0x04, 0x13, 0x58, 0x0c, 0xc2, 0x11, 0x92, 0xe2, 0xe2, 0x28, 0x2d, 0x4e, 0x2d, 0xf2, 0x4d, 0x2d, 109 0x49, 0x94, 0x60, 0x06, 0x4b, 0xc0, 0xf9, 0x42, 0x12, 0x5c, 0xec, 0x65, 0xa9, 0x45, 0xc5, 0x99, 110 0xf9, 0x79, 0x12, 0x2c, 0x0a, 0x8c, 0x1a, 0x2c, 0x41, 0x30, 0xae, 0x93, 0xc0, 0x89, 0x47, 0x72, 111 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe3, 0xb1, 0x1c, 0x43, 0x12, 0xc4, 112 0x05, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe0, 0xb7, 0xcb, 0x72, 0x98, 0x00, 0x00, 0x00, 113 } 114 115 func (m *KVPair) Marshal() (dAtA []byte, err error) { 116 size := m.Size() 117 dAtA = make([]byte, size) 118 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 119 if err != nil { 120 return nil, err 121 } 122 return dAtA[:n], nil 123 } 124 125 func (m *KVPair) MarshalTo(dAtA []byte) (int, error) { 126 size := m.Size() 127 return m.MarshalToSizedBuffer(dAtA[:size]) 128 } 129 130 func (m *KVPair) MarshalToSizedBuffer(dAtA []byte) (int, error) { 131 i := len(dAtA) 132 _ = i 133 var l int 134 _ = l 135 if m.XXX_unrecognized != nil { 136 i -= len(m.XXX_unrecognized) 137 copy(dAtA[i:], m.XXX_unrecognized) 138 } 139 if m.Version != 0 { 140 i = encodeVarintBackup(dAtA, i, uint64(m.Version)) 141 i-- 142 dAtA[i] = 0x20 143 } 144 if len(m.UserMeta) > 0 { 145 i -= len(m.UserMeta) 146 copy(dAtA[i:], m.UserMeta) 147 i = encodeVarintBackup(dAtA, i, uint64(len(m.UserMeta))) 148 i-- 149 dAtA[i] = 0x1a 150 } 151 if len(m.Value) > 0 { 152 i -= len(m.Value) 153 copy(dAtA[i:], m.Value) 154 i = encodeVarintBackup(dAtA, i, uint64(len(m.Value))) 155 i-- 156 dAtA[i] = 0x12 157 } 158 if len(m.Key) > 0 { 159 i -= len(m.Key) 160 copy(dAtA[i:], m.Key) 161 i = encodeVarintBackup(dAtA, i, uint64(len(m.Key))) 162 i-- 163 dAtA[i] = 0xa 164 } 165 return len(dAtA) - i, nil 166 } 167 168 func encodeVarintBackup(dAtA []byte, offset int, v uint64) int { 169 offset -= sovBackup(v) 170 base := offset 171 for v >= 1<<7 { 172 dAtA[offset] = uint8(v&0x7f | 0x80) 173 v >>= 7 174 offset++ 175 } 176 dAtA[offset] = uint8(v) 177 return base 178 } 179 func (m *KVPair) Size() (n int) { 180 if m == nil { 181 return 0 182 } 183 var l int 184 _ = l 185 l = len(m.Key) 186 if l > 0 { 187 n += 1 + l + sovBackup(uint64(l)) 188 } 189 l = len(m.Value) 190 if l > 0 { 191 n += 1 + l + sovBackup(uint64(l)) 192 } 193 l = len(m.UserMeta) 194 if l > 0 { 195 n += 1 + l + sovBackup(uint64(l)) 196 } 197 if m.Version != 0 { 198 n += 1 + sovBackup(uint64(m.Version)) 199 } 200 if m.XXX_unrecognized != nil { 201 n += len(m.XXX_unrecognized) 202 } 203 return n 204 } 205 206 func sovBackup(x uint64) (n int) { 207 return (math_bits.Len64(x|1) + 6) / 7 208 } 209 func sozBackup(x uint64) (n int) { 210 return sovBackup(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 211 } 212 func (m *KVPair) Unmarshal(dAtA []byte) error { 213 l := len(dAtA) 214 iNdEx := 0 215 for iNdEx < l { 216 preIndex := iNdEx 217 var wire uint64 218 for shift := uint(0); ; shift += 7 { 219 if shift >= 64 { 220 return ErrIntOverflowBackup 221 } 222 if iNdEx >= l { 223 return io.ErrUnexpectedEOF 224 } 225 b := dAtA[iNdEx] 226 iNdEx++ 227 wire |= uint64(b&0x7F) << shift 228 if b < 0x80 { 229 break 230 } 231 } 232 fieldNum := int32(wire >> 3) 233 wireType := int(wire & 0x7) 234 if wireType == 4 { 235 return fmt.Errorf("proto: KVPair: wiretype end group for non-group") 236 } 237 if fieldNum <= 0 { 238 return fmt.Errorf("proto: KVPair: illegal tag %d (wire type %d)", fieldNum, wire) 239 } 240 switch fieldNum { 241 case 1: 242 if wireType != 2 { 243 return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) 244 } 245 var byteLen int 246 for shift := uint(0); ; shift += 7 { 247 if shift >= 64 { 248 return ErrIntOverflowBackup 249 } 250 if iNdEx >= l { 251 return io.ErrUnexpectedEOF 252 } 253 b := dAtA[iNdEx] 254 iNdEx++ 255 byteLen |= int(b&0x7F) << shift 256 if b < 0x80 { 257 break 258 } 259 } 260 if byteLen < 0 { 261 return ErrInvalidLengthBackup 262 } 263 postIndex := iNdEx + byteLen 264 if postIndex < 0 { 265 return ErrInvalidLengthBackup 266 } 267 if postIndex > l { 268 return io.ErrUnexpectedEOF 269 } 270 m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) 271 if m.Key == nil { 272 m.Key = []byte{} 273 } 274 iNdEx = postIndex 275 case 2: 276 if wireType != 2 { 277 return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) 278 } 279 var byteLen int 280 for shift := uint(0); ; shift += 7 { 281 if shift >= 64 { 282 return ErrIntOverflowBackup 283 } 284 if iNdEx >= l { 285 return io.ErrUnexpectedEOF 286 } 287 b := dAtA[iNdEx] 288 iNdEx++ 289 byteLen |= int(b&0x7F) << shift 290 if b < 0x80 { 291 break 292 } 293 } 294 if byteLen < 0 { 295 return ErrInvalidLengthBackup 296 } 297 postIndex := iNdEx + byteLen 298 if postIndex < 0 { 299 return ErrInvalidLengthBackup 300 } 301 if postIndex > l { 302 return io.ErrUnexpectedEOF 303 } 304 m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) 305 if m.Value == nil { 306 m.Value = []byte{} 307 } 308 iNdEx = postIndex 309 case 3: 310 if wireType != 2 { 311 return fmt.Errorf("proto: wrong wireType = %d for field UserMeta", wireType) 312 } 313 var byteLen int 314 for shift := uint(0); ; shift += 7 { 315 if shift >= 64 { 316 return ErrIntOverflowBackup 317 } 318 if iNdEx >= l { 319 return io.ErrUnexpectedEOF 320 } 321 b := dAtA[iNdEx] 322 iNdEx++ 323 byteLen |= int(b&0x7F) << shift 324 if b < 0x80 { 325 break 326 } 327 } 328 if byteLen < 0 { 329 return ErrInvalidLengthBackup 330 } 331 postIndex := iNdEx + byteLen 332 if postIndex < 0 { 333 return ErrInvalidLengthBackup 334 } 335 if postIndex > l { 336 return io.ErrUnexpectedEOF 337 } 338 m.UserMeta = append(m.UserMeta[:0], dAtA[iNdEx:postIndex]...) 339 if m.UserMeta == nil { 340 m.UserMeta = []byte{} 341 } 342 iNdEx = postIndex 343 case 4: 344 if wireType != 0 { 345 return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) 346 } 347 m.Version = 0 348 for shift := uint(0); ; shift += 7 { 349 if shift >= 64 { 350 return ErrIntOverflowBackup 351 } 352 if iNdEx >= l { 353 return io.ErrUnexpectedEOF 354 } 355 b := dAtA[iNdEx] 356 iNdEx++ 357 m.Version |= uint64(b&0x7F) << shift 358 if b < 0x80 { 359 break 360 } 361 } 362 default: 363 iNdEx = preIndex 364 skippy, err := skipBackup(dAtA[iNdEx:]) 365 if err != nil { 366 return err 367 } 368 if skippy < 0 { 369 return ErrInvalidLengthBackup 370 } 371 if (iNdEx + skippy) < 0 { 372 return ErrInvalidLengthBackup 373 } 374 if (iNdEx + skippy) > l { 375 return io.ErrUnexpectedEOF 376 } 377 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 378 iNdEx += skippy 379 } 380 } 381 382 if iNdEx > l { 383 return io.ErrUnexpectedEOF 384 } 385 return nil 386 } 387 func skipBackup(dAtA []byte) (n int, err error) { 388 l := len(dAtA) 389 iNdEx := 0 390 depth := 0 391 for iNdEx < l { 392 var wire uint64 393 for shift := uint(0); ; shift += 7 { 394 if shift >= 64 { 395 return 0, ErrIntOverflowBackup 396 } 397 if iNdEx >= l { 398 return 0, io.ErrUnexpectedEOF 399 } 400 b := dAtA[iNdEx] 401 iNdEx++ 402 wire |= (uint64(b) & 0x7F) << shift 403 if b < 0x80 { 404 break 405 } 406 } 407 wireType := int(wire & 0x7) 408 switch wireType { 409 case 0: 410 for shift := uint(0); ; shift += 7 { 411 if shift >= 64 { 412 return 0, ErrIntOverflowBackup 413 } 414 if iNdEx >= l { 415 return 0, io.ErrUnexpectedEOF 416 } 417 iNdEx++ 418 if dAtA[iNdEx-1] < 0x80 { 419 break 420 } 421 } 422 case 1: 423 iNdEx += 8 424 case 2: 425 var length int 426 for shift := uint(0); ; shift += 7 { 427 if shift >= 64 { 428 return 0, ErrIntOverflowBackup 429 } 430 if iNdEx >= l { 431 return 0, io.ErrUnexpectedEOF 432 } 433 b := dAtA[iNdEx] 434 iNdEx++ 435 length |= (int(b) & 0x7F) << shift 436 if b < 0x80 { 437 break 438 } 439 } 440 if length < 0 { 441 return 0, ErrInvalidLengthBackup 442 } 443 iNdEx += length 444 case 3: 445 depth++ 446 case 4: 447 if depth == 0 { 448 return 0, ErrUnexpectedEndOfGroupBackup 449 } 450 depth-- 451 case 5: 452 iNdEx += 4 453 default: 454 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 455 } 456 if iNdEx < 0 { 457 return 0, ErrInvalidLengthBackup 458 } 459 if depth == 0 { 460 return iNdEx, nil 461 } 462 } 463 return 0, io.ErrUnexpectedEOF 464 } 465 466 var ( 467 ErrInvalidLengthBackup = fmt.Errorf("proto: negative length found during unmarshaling") 468 ErrIntOverflowBackup = fmt.Errorf("proto: integer overflow") 469 ErrUnexpectedEndOfGroupBackup = fmt.Errorf("proto: unexpected end of group") 470 )