File
Blob: spec/protocol/kv_vtproto.pb.go
| 1 | // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. |
| 2 | // protoc-gen-go-vtproto version: v0.6.0 |
| 3 | // source: spec/proto/kv.proto |
| 4 | |
| 5 | package protocol |
| 6 | |
| 7 | import ( |
| 8 | fmt "fmt" |
| 9 | protohelpers "github.com/planetscale/vtprotobuf/protohelpers" |
| 10 | durationpb "github.com/planetscale/vtprotobuf/types/known/durationpb" |
| 11 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" |
| 12 | durationpb1 "google.golang.org/protobuf/types/known/durationpb" |
| 13 | io "io" |
| 14 | ) |
| 15 | |
| 16 | const ( |
| 17 | // Verify that this generated code is sufficiently up-to-date. |
| 18 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) |
| 19 | // Verify that runtime/protoimpl is sufficiently up-to-date. |
| 20 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) |
| 21 | ) |
| 22 | |
| 23 | func (m *SimpleRequest) MarshalVT() (dAtA []byte, err error) { |
| 24 | if m == nil { |
| 25 | return nil, nil |
| 26 | } |
| 27 | size := m.SizeVT() |
| 28 | dAtA = make([]byte, size) |
| 29 | n, err := m.MarshalToSizedBufferVT(dAtA[:size]) |
| 30 | if err != nil { |
| 31 | return nil, err |
| 32 | } |
| 33 | return dAtA[:n], nil |
| 34 | } |
| 35 | |
| 36 | func (m *SimpleRequest) MarshalToVT(dAtA []byte) (int, error) { |
| 37 | size := m.SizeVT() |
| 38 | return m.MarshalToSizedBufferVT(dAtA[:size]) |
| 39 | } |
| 40 | |
| 41 | func (m *SimpleRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { |
| 42 | if m == nil { |
| 43 | return 0, nil |
| 44 | } |
| 45 | i := len(dAtA) |
| 46 | _ = i |
| 47 | var l int |
| 48 | _ = l |
| 49 | if m.unknownFields != nil { |
| 50 | i -= len(m.unknownFields) |
| 51 | copy(dAtA[i:], m.unknownFields) |
| 52 | } |
| 53 | if len(m.Value) > 0 { |
| 54 | i -= len(m.Value) |
| 55 | copy(dAtA[i:], m.Value) |
| 56 | i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Value))) |
| 57 | i-- |
| 58 | dAtA[i] = 0x12 |
| 59 | } |
| 60 | if len(m.Key) > 0 { |
| 61 | i -= len(m.Key) |
| 62 | copy(dAtA[i:], m.Key) |
| 63 | i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Key))) |
| 64 | i-- |
| 65 | dAtA[i] = 0xa |
| 66 | } |
| 67 | return len(dAtA) - i, nil |
| 68 | } |
| 69 | |
| 70 | func (m *SimpleResponse) MarshalVT() (dAtA []byte, err error) { |
| 71 | if m == nil { |
| 72 | return nil, nil |
| 73 | } |
| 74 | size := m.SizeVT() |
| 75 | dAtA = make([]byte, size) |
| 76 | n, err := m.MarshalToSizedBufferVT(dAtA[:size]) |
| 77 | if err != nil { |
| 78 | return nil, err |
| 79 | } |
| 80 | return dAtA[:n], nil |
| 81 | } |
| 82 | |
| 83 | func (m *SimpleResponse) MarshalToVT(dAtA []byte) (int, error) { |
| 84 | size := m.SizeVT() |
| 85 | return m.MarshalToSizedBufferVT(dAtA[:size]) |
| 86 | } |
| 87 | |
| 88 | func (m *SimpleResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { |
| 89 | if m == nil { |
| 90 | return 0, nil |
| 91 | } |
| 92 | i := len(dAtA) |
| 93 | _ = i |
| 94 | var l int |
| 95 | _ = l |
| 96 | if m.unknownFields != nil { |
| 97 | i -= len(m.unknownFields) |
| 98 | copy(dAtA[i:], m.unknownFields) |
| 99 | } |
| 100 | if len(m.Value) > 0 { |
| 101 | i -= len(m.Value) |
| 102 | copy(dAtA[i:], m.Value) |
| 103 | i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Value))) |
| 104 | i-- |
| 105 | dAtA[i] = 0xa |
| 106 | } |
| 107 | return len(dAtA) - i, nil |
| 108 | } |
| 109 | |
| 110 | func (m *PrefixRequest) MarshalVT() (dAtA []byte, err error) { |
| 111 | if m == nil { |
| 112 | return nil, nil |
| 113 | } |
| 114 | size := m.SizeVT() |
| 115 | dAtA = make([]byte, size) |
| 116 | n, err := m.MarshalToSizedBufferVT(dAtA[:size]) |
| 117 | if err != nil { |
| 118 | return nil, err |
| 119 | } |
| 120 | return dAtA[:n], nil |
| 121 | } |
| 122 | |
| 123 | func (m *PrefixRequest) MarshalToVT(dAtA []byte) (int, error) { |
| 124 | size := m.SizeVT() |
| 125 | return m.MarshalToSizedBufferVT(dAtA[:size]) |
| 126 | } |
| 127 | |
| 128 | func (m *PrefixRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { |
| 129 | if m == nil { |
| 130 | return 0, nil |
| 131 | } |
| 132 | i := len(dAtA) |
| 133 | _ = i |
| 134 | var l int |
| 135 | _ = l |
| 136 | if m.unknownFields != nil { |
| 137 | i -= len(m.unknownFields) |
| 138 | copy(dAtA[i:], m.unknownFields) |
| 139 | } |
| 140 | if len(m.Child) > 0 { |
| 141 | i -= len(m.Child) |
| 142 | copy(dAtA[i:], m.Child) |
| 143 | i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Child))) |
| 144 | i-- |
| 145 | dAtA[i] = 0x12 |
| 146 | } |
| 147 | if len(m.Prefix) > 0 { |
| 148 | i -= len(m.Prefix) |
| 149 | copy(dAtA[i:], m.Prefix) |
| 150 | i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Prefix))) |
| 151 | i-- |
| 152 | dAtA[i] = 0xa |
| 153 | } |
| 154 | return len(dAtA) - i, nil |
| 155 | } |
| 156 | |
| 157 | func (m *PrefixResponse) MarshalVT() (dAtA []byte, err error) { |
| 158 | if m == nil { |
| 159 | return nil, nil |
| 160 | } |
| 161 | size := m.SizeVT() |
| 162 | dAtA = make([]byte, size) |
| 163 | n, err := m.MarshalToSizedBufferVT(dAtA[:size]) |
| 164 | if err != nil { |
| 165 | return nil, err |
| 166 | } |
| 167 | return dAtA[:n], nil |
| 168 | } |
| 169 | |
| 170 | func (m *PrefixResponse) MarshalToVT(dAtA []byte) (int, error) { |
| 171 | size := m.SizeVT() |
| 172 | return m.MarshalToSizedBufferVT(dAtA[:size]) |
| 173 | } |
| 174 | |
| 175 | func (m *PrefixResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { |
| 176 | if m == nil { |
| 177 | return 0, nil |
| 178 | } |
| 179 | i := len(dAtA) |
| 180 | _ = i |
| 181 | var l int |
| 182 | _ = l |
| 183 | if m.unknownFields != nil { |
| 184 | i -= len(m.unknownFields) |
| 185 | copy(dAtA[i:], m.unknownFields) |
| 186 | } |
| 187 | if m.Exists { |
| 188 | i-- |
| 189 | if m.Exists { |
| 190 | dAtA[i] = 1 |
| 191 | } else { |
| 192 | dAtA[i] = 0 |
| 193 | } |
| 194 | i-- |
| 195 | dAtA[i] = 0x10 |
| 196 | } |
| 197 | if len(m.Children) > 0 { |
| 198 | for iNdEx := len(m.Children) - 1; iNdEx >= 0; iNdEx-- { |
| 199 | i -= len(m.Children[iNdEx]) |
| 200 | copy(dAtA[i:], m.Children[iNdEx]) |
| 201 | i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Children[iNdEx]))) |
| 202 | i-- |
| 203 | dAtA[i] = 0xa |
| 204 | } |
| 205 | } |
| 206 | return len(dAtA) - i, nil |
| 207 | } |
| 208 | |
| 209 | func (m *LeaseRequest) MarshalVT() (dAtA []byte, err error) { |
| 210 | if m == nil { |
| 211 | return nil, nil |
| 212 | } |
| 213 | size := m.SizeVT() |
| 214 | dAtA = make([]byte, size) |
| 215 | n, err := m.MarshalToSizedBufferVT(dAtA[:size]) |
| 216 | if err != nil { |
| 217 | return nil, err |
| 218 | } |
| 219 | return dAtA[:n], nil |
| 220 | } |
| 221 | |
| 222 | func (m *LeaseRequest) MarshalToVT(dAtA []byte) (int, error) { |
| 223 | size := m.SizeVT() |
| 224 | return m.MarshalToSizedBufferVT(dAtA[:size]) |
| 225 | } |
| 226 | |
| 227 | func (m *LeaseRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { |
| 228 | if m == nil { |
| 229 | return 0, nil |
| 230 | } |
| 231 | i := len(dAtA) |
| 232 | _ = i |
| 233 | var l int |
| 234 | _ = l |
| 235 | if m.unknownFields != nil { |
| 236 | i -= len(m.unknownFields) |
| 237 | copy(dAtA[i:], m.unknownFields) |
| 238 | } |
| 239 | if m.Ttl != nil { |
| 240 | size, err := (*durationpb.Duration)(m.Ttl).MarshalToSizedBufferVT(dAtA[:i]) |
| 241 | if err != nil { |
| 242 | return 0, err |
| 243 | } |
| 244 | i -= size |
| 245 | i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) |
| 246 | i-- |
| 247 | dAtA[i] = 0x2a |
| 248 | } |
| 249 | if m.PrevToken != 0 { |
| 250 | i = protohelpers.EncodeVarint(dAtA, i, uint64(m.PrevToken)) |
| 251 | i-- |
| 252 | dAtA[i] = 0x18 |
| 253 | } |
| 254 | if m.NewToken != 0 { |
| 255 | i = protohelpers.EncodeVarint(dAtA, i, uint64(m.NewToken)) |
| 256 | i-- |
| 257 | dAtA[i] = 0x10 |
| 258 | } |
| 259 | if len(m.Lease) > 0 { |
| 260 | i -= len(m.Lease) |
| 261 | copy(dAtA[i:], m.Lease) |
| 262 | i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Lease))) |
| 263 | i-- |
| 264 | dAtA[i] = 0xa |
| 265 | } |
| 266 | return len(dAtA) - i, nil |
| 267 | } |
| 268 | |
| 269 | func (m *LeaseResponse) MarshalVT() (dAtA []byte, err error) { |
| 270 | if m == nil { |
| 271 | return nil, nil |
| 272 | } |
| 273 | size := m.SizeVT() |
| 274 | dAtA = make([]byte, size) |
| 275 | n, err := m.MarshalToSizedBufferVT(dAtA[:size]) |
| 276 | if err != nil { |
| 277 | return nil, err |
| 278 | } |
| 279 | return dAtA[:n], nil |
| 280 | } |
| 281 | |
| 282 | func (m *LeaseResponse) MarshalToVT(dAtA []byte) (int, error) { |
| 283 | size := m.SizeVT() |
| 284 | return m.MarshalToSizedBufferVT(dAtA[:size]) |
| 285 | } |
| 286 | |
| 287 | func (m *LeaseResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { |
| 288 | if m == nil { |
| 289 | return 0, nil |
| 290 | } |
| 291 | i := len(dAtA) |
| 292 | _ = i |
| 293 | var l int |
| 294 | _ = l |
| 295 | if m.unknownFields != nil { |
| 296 | i -= len(m.unknownFields) |
| 297 | copy(dAtA[i:], m.unknownFields) |
| 298 | } |
| 299 | if m.Token != 0 { |
| 300 | i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Token)) |
| 301 | i-- |
| 302 | dAtA[i] = 0x8 |
| 303 | } |
| 304 | return len(dAtA) - i, nil |
| 305 | } |
| 306 | |
| 307 | func (m *KVTransfer) MarshalVT() (dAtA []byte, err error) { |
| 308 | if m == nil { |
| 309 | return nil, nil |
| 310 | } |
| 311 | size := m.SizeVT() |
| 312 | dAtA = make([]byte, size) |
| 313 | n, err := m.MarshalToSizedBufferVT(dAtA[:size]) |
| 314 | if err != nil { |
| 315 | return nil, err |
| 316 | } |
| 317 | return dAtA[:n], nil |
| 318 | } |
| 319 | |
| 320 | func (m *KVTransfer) MarshalToVT(dAtA []byte) (int, error) { |
| 321 | size := m.SizeVT() |
| 322 | return m.MarshalToSizedBufferVT(dAtA[:size]) |
| 323 | } |
| 324 | |
| 325 | func (m *KVTransfer) MarshalToSizedBufferVT(dAtA []byte) (int, error) { |
| 326 | if m == nil { |
| 327 | return 0, nil |
| 328 | } |
| 329 | i := len(dAtA) |
| 330 | _ = i |
| 331 | var l int |
| 332 | _ = l |
| 333 | if m.unknownFields != nil { |
| 334 | i -= len(m.unknownFields) |
| 335 | copy(dAtA[i:], m.unknownFields) |
| 336 | } |
| 337 | if m.LeaseToken != 0 { |
| 338 | i = protohelpers.EncodeVarint(dAtA, i, uint64(m.LeaseToken)) |
| 339 | i-- |
| 340 | dAtA[i] = 0x18 |
| 341 | } |
| 342 | if len(m.PrefixChildren) > 0 { |
| 343 | for iNdEx := len(m.PrefixChildren) - 1; iNdEx >= 0; iNdEx-- { |
| 344 | i -= len(m.PrefixChildren[iNdEx]) |
| 345 | copy(dAtA[i:], m.PrefixChildren[iNdEx]) |
| 346 | i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PrefixChildren[iNdEx]))) |
| 347 | i-- |
| 348 | dAtA[i] = 0x12 |
| 349 | } |
| 350 | } |
| 351 | if m.SimpleValue != nil { |
| 352 | i -= len(m.SimpleValue) |
| 353 | copy(dAtA[i:], m.SimpleValue) |
| 354 | i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SimpleValue))) |
| 355 | i-- |
| 356 | dAtA[i] = 0xa |
| 357 | } |
| 358 | return len(dAtA) - i, nil |
| 359 | } |
| 360 | |
| 361 | func (m *ImportRequest) MarshalVT() (dAtA []byte, err error) { |
| 362 | if m == nil { |
| 363 | return nil, nil |
| 364 | } |
| 365 | size := m.SizeVT() |
| 366 | dAtA = make([]byte, size) |
| 367 | n, err := m.MarshalToSizedBufferVT(dAtA[:size]) |
| 368 | if err != nil { |
| 369 | return nil, err |
| 370 | } |
| 371 | return dAtA[:n], nil |
| 372 | } |
| 373 | |
| 374 | func (m *ImportRequest) MarshalToVT(dAtA []byte) (int, error) { |
| 375 | size := m.SizeVT() |
| 376 | return m.MarshalToSizedBufferVT(dAtA[:size]) |
| 377 | } |
| 378 | |
| 379 | func (m *ImportRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { |
| 380 | if m == nil { |
| 381 | return 0, nil |
| 382 | } |
| 383 | i := len(dAtA) |
| 384 | _ = i |
| 385 | var l int |
| 386 | _ = l |
| 387 | if m.unknownFields != nil { |
| 388 | i -= len(m.unknownFields) |
| 389 | copy(dAtA[i:], m.unknownFields) |
| 390 | } |
| 391 | if len(m.Values) > 0 { |
| 392 | for iNdEx := len(m.Values) - 1; iNdEx >= 0; iNdEx-- { |
| 393 | size, err := m.Values[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) |
| 394 | if err != nil { |
| 395 | return 0, err |
| 396 | } |
| 397 | i -= size |
| 398 | i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) |
| 399 | i-- |
| 400 | dAtA[i] = 0x12 |
| 401 | } |
| 402 | } |
| 403 | if len(m.Keys) > 0 { |
| 404 | for iNdEx := len(m.Keys) - 1; iNdEx >= 0; iNdEx-- { |
| 405 | i -= len(m.Keys[iNdEx]) |
| 406 | copy(dAtA[i:], m.Keys[iNdEx]) |
| 407 | i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Keys[iNdEx]))) |
| 408 | i-- |
| 409 | dAtA[i] = 0xa |
| 410 | } |
| 411 | } |
| 412 | return len(dAtA) - i, nil |
| 413 | } |
| 414 | |
| 415 | func (m *ImportResponse) MarshalVT() (dAtA []byte, err error) { |
| 416 | if m == nil { |
| 417 | return nil, nil |
| 418 | } |
| 419 | size := m.SizeVT() |
| 420 | dAtA = make([]byte, size) |
| 421 | n, err := m.MarshalToSizedBufferVT(dAtA[:size]) |
| 422 | if err != nil { |
| 423 | return nil, err |
| 424 | } |
| 425 | return dAtA[:n], nil |
| 426 | } |
| 427 | |
| 428 | func (m *ImportResponse) MarshalToVT(dAtA []byte) (int, error) { |
| 429 | size := m.SizeVT() |
| 430 | return m.MarshalToSizedBufferVT(dAtA[:size]) |
| 431 | } |
| 432 | |
| 433 | func (m *ImportResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { |
| 434 | if m == nil { |
| 435 | return 0, nil |
| 436 | } |
| 437 | i := len(dAtA) |
| 438 | _ = i |
| 439 | var l int |
| 440 | _ = l |
| 441 | if m.unknownFields != nil { |
| 442 | i -= len(m.unknownFields) |
| 443 | copy(dAtA[i:], m.unknownFields) |
| 444 | } |
| 445 | return len(dAtA) - i, nil |
| 446 | } |
| 447 | |
| 448 | func (m *ListKeysRequest) MarshalVT() (dAtA []byte, err error) { |
| 449 | if m == nil { |
| 450 | return nil, nil |
| 451 | } |
| 452 | size := m.SizeVT() |
| 453 | dAtA = make([]byte, size) |
| 454 | n, err := m.MarshalToSizedBufferVT(dAtA[:size]) |
| 455 | if err != nil { |
| 456 | return nil, err |
| 457 | } |
| 458 | return dAtA[:n], nil |
| 459 | } |
| 460 | |
| 461 | func (m *ListKeysRequest) MarshalToVT(dAtA []byte) (int, error) { |
| 462 | size := m.SizeVT() |
| 463 | return m.MarshalToSizedBufferVT(dAtA[:size]) |
| 464 | } |
| 465 | |
| 466 | func (m *ListKeysRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { |
| 467 | if m == nil { |
| 468 | return 0, nil |
| 469 | } |
| 470 | i := len(dAtA) |
| 471 | _ = i |
| 472 | var l int |
| 473 | _ = l |
| 474 | if m.unknownFields != nil { |
| 475 | i -= len(m.unknownFields) |
| 476 | copy(dAtA[i:], m.unknownFields) |
| 477 | } |
| 478 | if len(m.Prefix) > 0 { |
| 479 | i -= len(m.Prefix) |
| 480 | copy(dAtA[i:], m.Prefix) |
| 481 | i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Prefix))) |
| 482 | i-- |
| 483 | dAtA[i] = 0xa |
| 484 | } |
| 485 | return len(dAtA) - i, nil |
| 486 | } |
| 487 | |
| 488 | func (m *KeyComposite) MarshalVT() (dAtA []byte, err error) { |
| 489 | if m == nil { |
| 490 | return nil, nil |
| 491 | } |
| 492 | size := m.SizeVT() |
| 493 | dAtA = make([]byte, size) |
| 494 | n, err := m.MarshalToSizedBufferVT(dAtA[:size]) |
| 495 | if err != nil { |
| 496 | return nil, err |
| 497 | } |
| 498 | return dAtA[:n], nil |
| 499 | } |
| 500 | |
| 501 | func (m *KeyComposite) MarshalToVT(dAtA []byte) (int, error) { |
| 502 | size := m.SizeVT() |
| 503 | return m.MarshalToSizedBufferVT(dAtA[:size]) |
| 504 | } |
| 505 | |
| 506 | func (m *KeyComposite) MarshalToSizedBufferVT(dAtA []byte) (int, error) { |
| 507 | if m == nil { |
| 508 | return 0, nil |
| 509 | } |
| 510 | i := len(dAtA) |
| 511 | _ = i |
| 512 | var l int |
| 513 | _ = l |
| 514 | if m.unknownFields != nil { |
| 515 | i -= len(m.unknownFields) |
| 516 | copy(dAtA[i:], m.unknownFields) |
| 517 | } |
| 518 | if m.Type != 0 { |
| 519 | i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Type)) |
| 520 | i-- |
| 521 | dAtA[i] = 0x10 |
| 522 | } |
| 523 | if len(m.Key) > 0 { |
| 524 | i -= len(m.Key) |
| 525 | copy(dAtA[i:], m.Key) |
| 526 | i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Key))) |
| 527 | i-- |
| 528 | dAtA[i] = 0xa |
| 529 | } |
| 530 | return len(dAtA) - i, nil |
| 531 | } |
| 532 | |
| 533 | func (m *ListKeysResponse) MarshalVT() (dAtA []byte, err error) { |
| 534 | if m == nil { |
| 535 | return nil, nil |
| 536 | } |
| 537 | size := m.SizeVT() |
| 538 | dAtA = make([]byte, size) |
| 539 | n, err := m.MarshalToSizedBufferVT(dAtA[:size]) |
| 540 | if err != nil { |
| 541 | return nil, err |
| 542 | } |
| 543 | return dAtA[:n], nil |
| 544 | } |
| 545 | |
| 546 | func (m *ListKeysResponse) MarshalToVT(dAtA []byte) (int, error) { |
| 547 | size := m.SizeVT() |
| 548 | return m.MarshalToSizedBufferVT(dAtA[:size]) |
| 549 | } |
| 550 | |
| 551 | func (m *ListKeysResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { |
| 552 | if m == nil { |
| 553 | return 0, nil |
| 554 | } |
| 555 | i := len(dAtA) |
| 556 | _ = i |
| 557 | var l int |
| 558 | _ = l |
| 559 | if m.unknownFields != nil { |
| 560 | i -= len(m.unknownFields) |
| 561 | copy(dAtA[i:], m.unknownFields) |
| 562 | } |
| 563 | if len(m.Keys) > 0 { |
| 564 | for iNdEx := len(m.Keys) - 1; iNdEx >= 0; iNdEx-- { |
| 565 | size, err := m.Keys[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) |
| 566 | if err != nil { |
| 567 | return 0, err |
| 568 | } |
| 569 | i -= size |
| 570 | i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) |
| 571 | i-- |
| 572 | dAtA[i] = 0xa |
| 573 | } |
| 574 | } |
| 575 | return len(dAtA) - i, nil |
| 576 | } |
| 577 | |
| 578 | func (m *SimpleRequest) SizeVT() (n int) { |
| 579 | if m == nil { |
| 580 | return 0 |
| 581 | } |
| 582 | var l int |
| 583 | _ = l |
| 584 | l = len(m.Key) |
| 585 | if l > 0 { |
| 586 | n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 587 | } |
| 588 | l = len(m.Value) |
| 589 | if l > 0 { |
| 590 | n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 591 | } |
| 592 | n += len(m.unknownFields) |
| 593 | return n |
| 594 | } |
| 595 | |
| 596 | func (m *SimpleResponse) SizeVT() (n int) { |
| 597 | if m == nil { |
| 598 | return 0 |
| 599 | } |
| 600 | var l int |
| 601 | _ = l |
| 602 | l = len(m.Value) |
| 603 | if l > 0 { |
| 604 | n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 605 | } |
| 606 | n += len(m.unknownFields) |
| 607 | return n |
| 608 | } |
| 609 | |
| 610 | func (m *PrefixRequest) SizeVT() (n int) { |
| 611 | if m == nil { |
| 612 | return 0 |
| 613 | } |
| 614 | var l int |
| 615 | _ = l |
| 616 | l = len(m.Prefix) |
| 617 | if l > 0 { |
| 618 | n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 619 | } |
| 620 | l = len(m.Child) |
| 621 | if l > 0 { |
| 622 | n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 623 | } |
| 624 | n += len(m.unknownFields) |
| 625 | return n |
| 626 | } |
| 627 | |
| 628 | func (m *PrefixResponse) SizeVT() (n int) { |
| 629 | if m == nil { |
| 630 | return 0 |
| 631 | } |
| 632 | var l int |
| 633 | _ = l |
| 634 | if len(m.Children) > 0 { |
| 635 | for _, b := range m.Children { |
| 636 | l = len(b) |
| 637 | n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 638 | } |
| 639 | } |
| 640 | if m.Exists { |
| 641 | n += 2 |
| 642 | } |
| 643 | n += len(m.unknownFields) |
| 644 | return n |
| 645 | } |
| 646 | |
| 647 | func (m *LeaseRequest) SizeVT() (n int) { |
| 648 | if m == nil { |
| 649 | return 0 |
| 650 | } |
| 651 | var l int |
| 652 | _ = l |
| 653 | l = len(m.Lease) |
| 654 | if l > 0 { |
| 655 | n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 656 | } |
| 657 | if m.NewToken != 0 { |
| 658 | n += 1 + protohelpers.SizeOfVarint(uint64(m.NewToken)) |
| 659 | } |
| 660 | if m.PrevToken != 0 { |
| 661 | n += 1 + protohelpers.SizeOfVarint(uint64(m.PrevToken)) |
| 662 | } |
| 663 | if m.Ttl != nil { |
| 664 | l = (*durationpb.Duration)(m.Ttl).SizeVT() |
| 665 | n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 666 | } |
| 667 | n += len(m.unknownFields) |
| 668 | return n |
| 669 | } |
| 670 | |
| 671 | func (m *LeaseResponse) SizeVT() (n int) { |
| 672 | if m == nil { |
| 673 | return 0 |
| 674 | } |
| 675 | var l int |
| 676 | _ = l |
| 677 | if m.Token != 0 { |
| 678 | n += 1 + protohelpers.SizeOfVarint(uint64(m.Token)) |
| 679 | } |
| 680 | n += len(m.unknownFields) |
| 681 | return n |
| 682 | } |
| 683 | |
| 684 | func (m *KVTransfer) SizeVT() (n int) { |
| 685 | if m == nil { |
| 686 | return 0 |
| 687 | } |
| 688 | var l int |
| 689 | _ = l |
| 690 | if m.SimpleValue != nil { |
| 691 | l = len(m.SimpleValue) |
| 692 | n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 693 | } |
| 694 | if len(m.PrefixChildren) > 0 { |
| 695 | for _, b := range m.PrefixChildren { |
| 696 | l = len(b) |
| 697 | n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 698 | } |
| 699 | } |
| 700 | if m.LeaseToken != 0 { |
| 701 | n += 1 + protohelpers.SizeOfVarint(uint64(m.LeaseToken)) |
| 702 | } |
| 703 | n += len(m.unknownFields) |
| 704 | return n |
| 705 | } |
| 706 | |
| 707 | func (m *ImportRequest) SizeVT() (n int) { |
| 708 | if m == nil { |
| 709 | return 0 |
| 710 | } |
| 711 | var l int |
| 712 | _ = l |
| 713 | if len(m.Keys) > 0 { |
| 714 | for _, b := range m.Keys { |
| 715 | l = len(b) |
| 716 | n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 717 | } |
| 718 | } |
| 719 | if len(m.Values) > 0 { |
| 720 | for _, e := range m.Values { |
| 721 | l = e.SizeVT() |
| 722 | n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 723 | } |
| 724 | } |
| 725 | n += len(m.unknownFields) |
| 726 | return n |
| 727 | } |
| 728 | |
| 729 | func (m *ImportResponse) SizeVT() (n int) { |
| 730 | if m == nil { |
| 731 | return 0 |
| 732 | } |
| 733 | var l int |
| 734 | _ = l |
| 735 | n += len(m.unknownFields) |
| 736 | return n |
| 737 | } |
| 738 | |
| 739 | func (m *ListKeysRequest) SizeVT() (n int) { |
| 740 | if m == nil { |
| 741 | return 0 |
| 742 | } |
| 743 | var l int |
| 744 | _ = l |
| 745 | l = len(m.Prefix) |
| 746 | if l > 0 { |
| 747 | n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 748 | } |
| 749 | n += len(m.unknownFields) |
| 750 | return n |
| 751 | } |
| 752 | |
| 753 | func (m *KeyComposite) SizeVT() (n int) { |
| 754 | if m == nil { |
| 755 | return 0 |
| 756 | } |
| 757 | var l int |
| 758 | _ = l |
| 759 | l = len(m.Key) |
| 760 | if l > 0 { |
| 761 | n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 762 | } |
| 763 | if m.Type != 0 { |
| 764 | n += 1 + protohelpers.SizeOfVarint(uint64(m.Type)) |
| 765 | } |
| 766 | n += len(m.unknownFields) |
| 767 | return n |
| 768 | } |
| 769 | |
| 770 | func (m *ListKeysResponse) SizeVT() (n int) { |
| 771 | if m == nil { |
| 772 | return 0 |
| 773 | } |
| 774 | var l int |
| 775 | _ = l |
| 776 | if len(m.Keys) > 0 { |
| 777 | for _, e := range m.Keys { |
| 778 | l = e.SizeVT() |
| 779 | n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 780 | } |
| 781 | } |
| 782 | n += len(m.unknownFields) |
| 783 | return n |
| 784 | } |
| 785 | |
| 786 | func (m *SimpleRequest) UnmarshalVT(dAtA []byte) error { |
| 787 | l := len(dAtA) |
| 788 | iNdEx := 0 |
| 789 | for iNdEx < l { |
| 790 | preIndex := iNdEx |
| 791 | var wire uint64 |
| 792 | for shift := uint(0); ; shift += 7 { |
| 793 | if shift >= 64 { |
| 794 | return protohelpers.ErrIntOverflow |
| 795 | } |
| 796 | if iNdEx >= l { |
| 797 | return io.ErrUnexpectedEOF |
| 798 | } |
| 799 | b := dAtA[iNdEx] |
| 800 | iNdEx++ |
| 801 | wire |= uint64(b&0x7F) << shift |
| 802 | if b < 0x80 { |
| 803 | break |
| 804 | } |
| 805 | } |
| 806 | fieldNum := int32(wire >> 3) |
| 807 | wireType := int(wire & 0x7) |
| 808 | if wireType == 4 { |
| 809 | return fmt.Errorf("proto: SimpleRequest: wiretype end group for non-group") |
| 810 | } |
| 811 | if fieldNum <= 0 { |
| 812 | return fmt.Errorf("proto: SimpleRequest: illegal tag %d (wire type %d)", fieldNum, wire) |
| 813 | } |
| 814 | switch fieldNum { |
| 815 | case 1: |
| 816 | if wireType != 2 { |
| 817 | return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) |
| 818 | } |
| 819 | var byteLen int |
| 820 | for shift := uint(0); ; shift += 7 { |
| 821 | if shift >= 64 { |
| 822 | return protohelpers.ErrIntOverflow |
| 823 | } |
| 824 | if iNdEx >= l { |
| 825 | return io.ErrUnexpectedEOF |
| 826 | } |
| 827 | b := dAtA[iNdEx] |
| 828 | iNdEx++ |
| 829 | byteLen |= int(b&0x7F) << shift |
| 830 | if b < 0x80 { |
| 831 | break |
| 832 | } |
| 833 | } |
| 834 | if byteLen < 0 { |
| 835 | return protohelpers.ErrInvalidLength |
| 836 | } |
| 837 | postIndex := iNdEx + byteLen |
| 838 | if postIndex < 0 { |
| 839 | return protohelpers.ErrInvalidLength |
| 840 | } |
| 841 | if postIndex > l { |
| 842 | return io.ErrUnexpectedEOF |
| 843 | } |
| 844 | m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) |
| 845 | if m.Key == nil { |
| 846 | m.Key = []byte{} |
| 847 | } |
| 848 | iNdEx = postIndex |
| 849 | case 2: |
| 850 | if wireType != 2 { |
| 851 | return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) |
| 852 | } |
| 853 | var byteLen int |
| 854 | for shift := uint(0); ; shift += 7 { |
| 855 | if shift >= 64 { |
| 856 | return protohelpers.ErrIntOverflow |
| 857 | } |
| 858 | if iNdEx >= l { |
| 859 | return io.ErrUnexpectedEOF |
| 860 | } |
| 861 | b := dAtA[iNdEx] |
| 862 | iNdEx++ |
| 863 | byteLen |= int(b&0x7F) << shift |
| 864 | if b < 0x80 { |
| 865 | break |
| 866 | } |
| 867 | } |
| 868 | if byteLen < 0 { |
| 869 | return protohelpers.ErrInvalidLength |
| 870 | } |
| 871 | postIndex := iNdEx + byteLen |
| 872 | if postIndex < 0 { |
| 873 | return protohelpers.ErrInvalidLength |
| 874 | } |
| 875 | if postIndex > l { |
| 876 | return io.ErrUnexpectedEOF |
| 877 | } |
| 878 | m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) |
| 879 | if m.Value == nil { |
| 880 | m.Value = []byte{} |
| 881 | } |
| 882 | iNdEx = postIndex |
| 883 | default: |
| 884 | iNdEx = preIndex |
| 885 | skippy, err := protohelpers.Skip(dAtA[iNdEx:]) |
| 886 | if err != nil { |
| 887 | return err |
| 888 | } |
| 889 | if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 890 | return protohelpers.ErrInvalidLength |
| 891 | } |
| 892 | if (iNdEx + skippy) > l { |
| 893 | return io.ErrUnexpectedEOF |
| 894 | } |
| 895 | m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) |
| 896 | iNdEx += skippy |
| 897 | } |
| 898 | } |
| 899 | |
| 900 | if iNdEx > l { |
| 901 | return io.ErrUnexpectedEOF |
| 902 | } |
| 903 | return nil |
| 904 | } |
| 905 | func (m *SimpleResponse) UnmarshalVT(dAtA []byte) error { |
| 906 | l := len(dAtA) |
| 907 | iNdEx := 0 |
| 908 | for iNdEx < l { |
| 909 | preIndex := iNdEx |
| 910 | var wire uint64 |
| 911 | for shift := uint(0); ; shift += 7 { |
| 912 | if shift >= 64 { |
| 913 | return protohelpers.ErrIntOverflow |
| 914 | } |
| 915 | if iNdEx >= l { |
| 916 | return io.ErrUnexpectedEOF |
| 917 | } |
| 918 | b := dAtA[iNdEx] |
| 919 | iNdEx++ |
| 920 | wire |= uint64(b&0x7F) << shift |
| 921 | if b < 0x80 { |
| 922 | break |
| 923 | } |
| 924 | } |
| 925 | fieldNum := int32(wire >> 3) |
| 926 | wireType := int(wire & 0x7) |
| 927 | if wireType == 4 { |
| 928 | return fmt.Errorf("proto: SimpleResponse: wiretype end group for non-group") |
| 929 | } |
| 930 | if fieldNum <= 0 { |
| 931 | return fmt.Errorf("proto: SimpleResponse: illegal tag %d (wire type %d)", fieldNum, wire) |
| 932 | } |
| 933 | switch fieldNum { |
| 934 | case 1: |
| 935 | if wireType != 2 { |
| 936 | return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) |
| 937 | } |
| 938 | var byteLen int |
| 939 | for shift := uint(0); ; shift += 7 { |
| 940 | if shift >= 64 { |
| 941 | return protohelpers.ErrIntOverflow |
| 942 | } |
| 943 | if iNdEx >= l { |
| 944 | return io.ErrUnexpectedEOF |
| 945 | } |
| 946 | b := dAtA[iNdEx] |
| 947 | iNdEx++ |
| 948 | byteLen |= int(b&0x7F) << shift |
| 949 | if b < 0x80 { |
| 950 | break |
| 951 | } |
| 952 | } |
| 953 | if byteLen < 0 { |
| 954 | return protohelpers.ErrInvalidLength |
| 955 | } |
| 956 | postIndex := iNdEx + byteLen |
| 957 | if postIndex < 0 { |
| 958 | return protohelpers.ErrInvalidLength |
| 959 | } |
| 960 | if postIndex > l { |
| 961 | return io.ErrUnexpectedEOF |
| 962 | } |
| 963 | m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) |
| 964 | if m.Value == nil { |
| 965 | m.Value = []byte{} |
| 966 | } |
| 967 | iNdEx = postIndex |
| 968 | default: |
| 969 | iNdEx = preIndex |
| 970 | skippy, err := protohelpers.Skip(dAtA[iNdEx:]) |
| 971 | if err != nil { |
| 972 | return err |
| 973 | } |
| 974 | if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 975 | return protohelpers.ErrInvalidLength |
| 976 | } |
| 977 | if (iNdEx + skippy) > l { |
| 978 | return io.ErrUnexpectedEOF |
| 979 | } |
| 980 | m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) |
| 981 | iNdEx += skippy |
| 982 | } |
| 983 | } |
| 984 | |
| 985 | if iNdEx > l { |
| 986 | return io.ErrUnexpectedEOF |
| 987 | } |
| 988 | return nil |
| 989 | } |
| 990 | func (m *PrefixRequest) UnmarshalVT(dAtA []byte) error { |
| 991 | l := len(dAtA) |
| 992 | iNdEx := 0 |
| 993 | for iNdEx < l { |
| 994 | preIndex := iNdEx |
| 995 | var wire uint64 |
| 996 | for shift := uint(0); ; shift += 7 { |
| 997 | if shift >= 64 { |
| 998 | return protohelpers.ErrIntOverflow |
| 999 | } |
| 1000 | if iNdEx >= l { |
| 1001 | return io.ErrUnexpectedEOF |
| 1002 | } |
| 1003 | b := dAtA[iNdEx] |
| 1004 | iNdEx++ |
| 1005 | wire |= uint64(b&0x7F) << shift |
| 1006 | if b < 0x80 { |
| 1007 | break |
| 1008 | } |
| 1009 | } |
| 1010 | fieldNum := int32(wire >> 3) |
| 1011 | wireType := int(wire & 0x7) |
| 1012 | if wireType == 4 { |
| 1013 | return fmt.Errorf("proto: PrefixRequest: wiretype end group for non-group") |
| 1014 | } |
| 1015 | if fieldNum <= 0 { |
| 1016 | return fmt.Errorf("proto: PrefixRequest: illegal tag %d (wire type %d)", fieldNum, wire) |
| 1017 | } |
| 1018 | switch fieldNum { |
| 1019 | case 1: |
| 1020 | if wireType != 2 { |
| 1021 | return fmt.Errorf("proto: wrong wireType = %d for field Prefix", wireType) |
| 1022 | } |
| 1023 | var byteLen int |
| 1024 | for shift := uint(0); ; shift += 7 { |
| 1025 | if shift >= 64 { |
| 1026 | return protohelpers.ErrIntOverflow |
| 1027 | } |
| 1028 | if iNdEx >= l { |
| 1029 | return io.ErrUnexpectedEOF |
| 1030 | } |
| 1031 | b := dAtA[iNdEx] |
| 1032 | iNdEx++ |
| 1033 | byteLen |= int(b&0x7F) << shift |
| 1034 | if b < 0x80 { |
| 1035 | break |
| 1036 | } |
| 1037 | } |
| 1038 | if byteLen < 0 { |
| 1039 | return protohelpers.ErrInvalidLength |
| 1040 | } |
| 1041 | postIndex := iNdEx + byteLen |
| 1042 | if postIndex < 0 { |
| 1043 | return protohelpers.ErrInvalidLength |
| 1044 | } |
| 1045 | if postIndex > l { |
| 1046 | return io.ErrUnexpectedEOF |
| 1047 | } |
| 1048 | m.Prefix = append(m.Prefix[:0], dAtA[iNdEx:postIndex]...) |
| 1049 | if m.Prefix == nil { |
| 1050 | m.Prefix = []byte{} |
| 1051 | } |
| 1052 | iNdEx = postIndex |
| 1053 | case 2: |
| 1054 | if wireType != 2 { |
| 1055 | return fmt.Errorf("proto: wrong wireType = %d for field Child", wireType) |
| 1056 | } |
| 1057 | var byteLen int |
| 1058 | for shift := uint(0); ; shift += 7 { |
| 1059 | if shift >= 64 { |
| 1060 | return protohelpers.ErrIntOverflow |
| 1061 | } |
| 1062 | if iNdEx >= l { |
| 1063 | return io.ErrUnexpectedEOF |
| 1064 | } |
| 1065 | b := dAtA[iNdEx] |
| 1066 | iNdEx++ |
| 1067 | byteLen |= int(b&0x7F) << shift |
| 1068 | if b < 0x80 { |
| 1069 | break |
| 1070 | } |
| 1071 | } |
| 1072 | if byteLen < 0 { |
| 1073 | return protohelpers.ErrInvalidLength |
| 1074 | } |
| 1075 | postIndex := iNdEx + byteLen |
| 1076 | if postIndex < 0 { |
| 1077 | return protohelpers.ErrInvalidLength |
| 1078 | } |
| 1079 | if postIndex > l { |
| 1080 | return io.ErrUnexpectedEOF |
| 1081 | } |
| 1082 | m.Child = append(m.Child[:0], dAtA[iNdEx:postIndex]...) |
| 1083 | if m.Child == nil { |
| 1084 | m.Child = []byte{} |
| 1085 | } |
| 1086 | iNdEx = postIndex |
| 1087 | default: |
| 1088 | iNdEx = preIndex |
| 1089 | skippy, err := protohelpers.Skip(dAtA[iNdEx:]) |
| 1090 | if err != nil { |
| 1091 | return err |
| 1092 | } |
| 1093 | if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 1094 | return protohelpers.ErrInvalidLength |
| 1095 | } |
| 1096 | if (iNdEx + skippy) > l { |
| 1097 | return io.ErrUnexpectedEOF |
| 1098 | } |
| 1099 | m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) |
| 1100 | iNdEx += skippy |
| 1101 | } |
| 1102 | } |
| 1103 | |
| 1104 | if iNdEx > l { |
| 1105 | return io.ErrUnexpectedEOF |
| 1106 | } |
| 1107 | return nil |
| 1108 | } |
| 1109 | func (m *PrefixResponse) UnmarshalVT(dAtA []byte) error { |
| 1110 | l := len(dAtA) |
| 1111 | iNdEx := 0 |
| 1112 | for iNdEx < l { |
| 1113 | preIndex := iNdEx |
| 1114 | var wire uint64 |
| 1115 | for shift := uint(0); ; shift += 7 { |
| 1116 | if shift >= 64 { |
| 1117 | return protohelpers.ErrIntOverflow |
| 1118 | } |
| 1119 | if iNdEx >= l { |
| 1120 | return io.ErrUnexpectedEOF |
| 1121 | } |
| 1122 | b := dAtA[iNdEx] |
| 1123 | iNdEx++ |
| 1124 | wire |= uint64(b&0x7F) << shift |
| 1125 | if b < 0x80 { |
| 1126 | break |
| 1127 | } |
| 1128 | } |
| 1129 | fieldNum := int32(wire >> 3) |
| 1130 | wireType := int(wire & 0x7) |
| 1131 | if wireType == 4 { |
| 1132 | return fmt.Errorf("proto: PrefixResponse: wiretype end group for non-group") |
| 1133 | } |
| 1134 | if fieldNum <= 0 { |
| 1135 | return fmt.Errorf("proto: PrefixResponse: illegal tag %d (wire type %d)", fieldNum, wire) |
| 1136 | } |
| 1137 | switch fieldNum { |
| 1138 | case 1: |
| 1139 | if wireType != 2 { |
| 1140 | return fmt.Errorf("proto: wrong wireType = %d for field Children", wireType) |
| 1141 | } |
| 1142 | var byteLen int |
| 1143 | for shift := uint(0); ; shift += 7 { |
| 1144 | if shift >= 64 { |
| 1145 | return protohelpers.ErrIntOverflow |
| 1146 | } |
| 1147 | if iNdEx >= l { |
| 1148 | return io.ErrUnexpectedEOF |
| 1149 | } |
| 1150 | b := dAtA[iNdEx] |
| 1151 | iNdEx++ |
| 1152 | byteLen |= int(b&0x7F) << shift |
| 1153 | if b < 0x80 { |
| 1154 | break |
| 1155 | } |
| 1156 | } |
| 1157 | if byteLen < 0 { |
| 1158 | return protohelpers.ErrInvalidLength |
| 1159 | } |
| 1160 | postIndex := iNdEx + byteLen |
| 1161 | if postIndex < 0 { |
| 1162 | return protohelpers.ErrInvalidLength |
| 1163 | } |
| 1164 | if postIndex > l { |
| 1165 | return io.ErrUnexpectedEOF |
| 1166 | } |
| 1167 | m.Children = append(m.Children, make([]byte, postIndex-iNdEx)) |
| 1168 | copy(m.Children[len(m.Children)-1], dAtA[iNdEx:postIndex]) |
| 1169 | iNdEx = postIndex |
| 1170 | case 2: |
| 1171 | if wireType != 0 { |
| 1172 | return fmt.Errorf("proto: wrong wireType = %d for field Exists", wireType) |
| 1173 | } |
| 1174 | var v int |
| 1175 | for shift := uint(0); ; shift += 7 { |
| 1176 | if shift >= 64 { |
| 1177 | return protohelpers.ErrIntOverflow |
| 1178 | } |
| 1179 | if iNdEx >= l { |
| 1180 | return io.ErrUnexpectedEOF |
| 1181 | } |
| 1182 | b := dAtA[iNdEx] |
| 1183 | iNdEx++ |
| 1184 | v |= int(b&0x7F) << shift |
| 1185 | if b < 0x80 { |
| 1186 | break |
| 1187 | } |
| 1188 | } |
| 1189 | m.Exists = bool(v != 0) |
| 1190 | default: |
| 1191 | iNdEx = preIndex |
| 1192 | skippy, err := protohelpers.Skip(dAtA[iNdEx:]) |
| 1193 | if err != nil { |
| 1194 | return err |
| 1195 | } |
| 1196 | if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 1197 | return protohelpers.ErrInvalidLength |
| 1198 | } |
| 1199 | if (iNdEx + skippy) > l { |
| 1200 | return io.ErrUnexpectedEOF |
| 1201 | } |
| 1202 | m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) |
| 1203 | iNdEx += skippy |
| 1204 | } |
| 1205 | } |
| 1206 | |
| 1207 | if iNdEx > l { |
| 1208 | return io.ErrUnexpectedEOF |
| 1209 | } |
| 1210 | return nil |
| 1211 | } |
| 1212 | func (m *LeaseRequest) UnmarshalVT(dAtA []byte) error { |
| 1213 | l := len(dAtA) |
| 1214 | iNdEx := 0 |
| 1215 | for iNdEx < l { |
| 1216 | preIndex := iNdEx |
| 1217 | var wire uint64 |
| 1218 | for shift := uint(0); ; shift += 7 { |
| 1219 | if shift >= 64 { |
| 1220 | return protohelpers.ErrIntOverflow |
| 1221 | } |
| 1222 | if iNdEx >= l { |
| 1223 | return io.ErrUnexpectedEOF |
| 1224 | } |
| 1225 | b := dAtA[iNdEx] |
| 1226 | iNdEx++ |
| 1227 | wire |= uint64(b&0x7F) << shift |
| 1228 | if b < 0x80 { |
| 1229 | break |
| 1230 | } |
| 1231 | } |
| 1232 | fieldNum := int32(wire >> 3) |
| 1233 | wireType := int(wire & 0x7) |
| 1234 | if wireType == 4 { |
| 1235 | return fmt.Errorf("proto: LeaseRequest: wiretype end group for non-group") |
| 1236 | } |
| 1237 | if fieldNum <= 0 { |
| 1238 | return fmt.Errorf("proto: LeaseRequest: illegal tag %d (wire type %d)", fieldNum, wire) |
| 1239 | } |
| 1240 | switch fieldNum { |
| 1241 | case 1: |
| 1242 | if wireType != 2 { |
| 1243 | return fmt.Errorf("proto: wrong wireType = %d for field Lease", wireType) |
| 1244 | } |
| 1245 | var byteLen int |
| 1246 | for shift := uint(0); ; shift += 7 { |
| 1247 | if shift >= 64 { |
| 1248 | return protohelpers.ErrIntOverflow |
| 1249 | } |
| 1250 | if iNdEx >= l { |
| 1251 | return io.ErrUnexpectedEOF |
| 1252 | } |
| 1253 | b := dAtA[iNdEx] |
| 1254 | iNdEx++ |
| 1255 | byteLen |= int(b&0x7F) << shift |
| 1256 | if b < 0x80 { |
| 1257 | break |
| 1258 | } |
| 1259 | } |
| 1260 | if byteLen < 0 { |
| 1261 | return protohelpers.ErrInvalidLength |
| 1262 | } |
| 1263 | postIndex := iNdEx + byteLen |
| 1264 | if postIndex < 0 { |
| 1265 | return protohelpers.ErrInvalidLength |
| 1266 | } |
| 1267 | if postIndex > l { |
| 1268 | return io.ErrUnexpectedEOF |
| 1269 | } |
| 1270 | m.Lease = append(m.Lease[:0], dAtA[iNdEx:postIndex]...) |
| 1271 | if m.Lease == nil { |
| 1272 | m.Lease = []byte{} |
| 1273 | } |
| 1274 | iNdEx = postIndex |
| 1275 | case 2: |
| 1276 | if wireType != 0 { |
| 1277 | return fmt.Errorf("proto: wrong wireType = %d for field NewToken", wireType) |
| 1278 | } |
| 1279 | m.NewToken = 0 |
| 1280 | for shift := uint(0); ; shift += 7 { |
| 1281 | if shift >= 64 { |
| 1282 | return protohelpers.ErrIntOverflow |
| 1283 | } |
| 1284 | if iNdEx >= l { |
| 1285 | return io.ErrUnexpectedEOF |
| 1286 | } |
| 1287 | b := dAtA[iNdEx] |
| 1288 | iNdEx++ |
| 1289 | m.NewToken |= uint64(b&0x7F) << shift |
| 1290 | if b < 0x80 { |
| 1291 | break |
| 1292 | } |
| 1293 | } |
| 1294 | case 3: |
| 1295 | if wireType != 0 { |
| 1296 | return fmt.Errorf("proto: wrong wireType = %d for field PrevToken", wireType) |
| 1297 | } |
| 1298 | m.PrevToken = 0 |
| 1299 | for shift := uint(0); ; shift += 7 { |
| 1300 | if shift >= 64 { |
| 1301 | return protohelpers.ErrIntOverflow |
| 1302 | } |
| 1303 | if iNdEx >= l { |
| 1304 | return io.ErrUnexpectedEOF |
| 1305 | } |
| 1306 | b := dAtA[iNdEx] |
| 1307 | iNdEx++ |
| 1308 | m.PrevToken |= uint64(b&0x7F) << shift |
| 1309 | if b < 0x80 { |
| 1310 | break |
| 1311 | } |
| 1312 | } |
| 1313 | case 5: |
| 1314 | if wireType != 2 { |
| 1315 | return fmt.Errorf("proto: wrong wireType = %d for field Ttl", wireType) |
| 1316 | } |
| 1317 | var msglen int |
| 1318 | for shift := uint(0); ; shift += 7 { |
| 1319 | if shift >= 64 { |
| 1320 | return protohelpers.ErrIntOverflow |
| 1321 | } |
| 1322 | if iNdEx >= l { |
| 1323 | return io.ErrUnexpectedEOF |
| 1324 | } |
| 1325 | b := dAtA[iNdEx] |
| 1326 | iNdEx++ |
| 1327 | msglen |= int(b&0x7F) << shift |
| 1328 | if b < 0x80 { |
| 1329 | break |
| 1330 | } |
| 1331 | } |
| 1332 | if msglen < 0 { |
| 1333 | return protohelpers.ErrInvalidLength |
| 1334 | } |
| 1335 | postIndex := iNdEx + msglen |
| 1336 | if postIndex < 0 { |
| 1337 | return protohelpers.ErrInvalidLength |
| 1338 | } |
| 1339 | if postIndex > l { |
| 1340 | return io.ErrUnexpectedEOF |
| 1341 | } |
| 1342 | if m.Ttl == nil { |
| 1343 | m.Ttl = &durationpb1.Duration{} |
| 1344 | } |
| 1345 | if err := (*durationpb.Duration)(m.Ttl).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { |
| 1346 | return err |
| 1347 | } |
| 1348 | iNdEx = postIndex |
| 1349 | default: |
| 1350 | iNdEx = preIndex |
| 1351 | skippy, err := protohelpers.Skip(dAtA[iNdEx:]) |
| 1352 | if err != nil { |
| 1353 | return err |
| 1354 | } |
| 1355 | if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 1356 | return protohelpers.ErrInvalidLength |
| 1357 | } |
| 1358 | if (iNdEx + skippy) > l { |
| 1359 | return io.ErrUnexpectedEOF |
| 1360 | } |
| 1361 | m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) |
| 1362 | iNdEx += skippy |
| 1363 | } |
| 1364 | } |
| 1365 | |
| 1366 | if iNdEx > l { |
| 1367 | return io.ErrUnexpectedEOF |
| 1368 | } |
| 1369 | return nil |
| 1370 | } |
| 1371 | func (m *LeaseResponse) UnmarshalVT(dAtA []byte) error { |
| 1372 | l := len(dAtA) |
| 1373 | iNdEx := 0 |
| 1374 | for iNdEx < l { |
| 1375 | preIndex := iNdEx |
| 1376 | var wire uint64 |
| 1377 | for shift := uint(0); ; shift += 7 { |
| 1378 | if shift >= 64 { |
| 1379 | return protohelpers.ErrIntOverflow |
| 1380 | } |
| 1381 | if iNdEx >= l { |
| 1382 | return io.ErrUnexpectedEOF |
| 1383 | } |
| 1384 | b := dAtA[iNdEx] |
| 1385 | iNdEx++ |
| 1386 | wire |= uint64(b&0x7F) << shift |
| 1387 | if b < 0x80 { |
| 1388 | break |
| 1389 | } |
| 1390 | } |
| 1391 | fieldNum := int32(wire >> 3) |
| 1392 | wireType := int(wire & 0x7) |
| 1393 | if wireType == 4 { |
| 1394 | return fmt.Errorf("proto: LeaseResponse: wiretype end group for non-group") |
| 1395 | } |
| 1396 | if fieldNum <= 0 { |
| 1397 | return fmt.Errorf("proto: LeaseResponse: illegal tag %d (wire type %d)", fieldNum, wire) |
| 1398 | } |
| 1399 | switch fieldNum { |
| 1400 | case 1: |
| 1401 | if wireType != 0 { |
| 1402 | return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) |
| 1403 | } |
| 1404 | m.Token = 0 |
| 1405 | for shift := uint(0); ; shift += 7 { |
| 1406 | if shift >= 64 { |
| 1407 | return protohelpers.ErrIntOverflow |
| 1408 | } |
| 1409 | if iNdEx >= l { |
| 1410 | return io.ErrUnexpectedEOF |
| 1411 | } |
| 1412 | b := dAtA[iNdEx] |
| 1413 | iNdEx++ |
| 1414 | m.Token |= uint64(b&0x7F) << shift |
| 1415 | if b < 0x80 { |
| 1416 | break |
| 1417 | } |
| 1418 | } |
| 1419 | default: |
| 1420 | iNdEx = preIndex |
| 1421 | skippy, err := protohelpers.Skip(dAtA[iNdEx:]) |
| 1422 | if err != nil { |
| 1423 | return err |
| 1424 | } |
| 1425 | if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 1426 | return protohelpers.ErrInvalidLength |
| 1427 | } |
| 1428 | if (iNdEx + skippy) > l { |
| 1429 | return io.ErrUnexpectedEOF |
| 1430 | } |
| 1431 | m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) |
| 1432 | iNdEx += skippy |
| 1433 | } |
| 1434 | } |
| 1435 | |
| 1436 | if iNdEx > l { |
| 1437 | return io.ErrUnexpectedEOF |
| 1438 | } |
| 1439 | return nil |
| 1440 | } |
| 1441 | func (m *KVTransfer) UnmarshalVT(dAtA []byte) error { |
| 1442 | l := len(dAtA) |
| 1443 | iNdEx := 0 |
| 1444 | for iNdEx < l { |
| 1445 | preIndex := iNdEx |
| 1446 | var wire uint64 |
| 1447 | for shift := uint(0); ; shift += 7 { |
| 1448 | if shift >= 64 { |
| 1449 | return protohelpers.ErrIntOverflow |
| 1450 | } |
| 1451 | if iNdEx >= l { |
| 1452 | return io.ErrUnexpectedEOF |
| 1453 | } |
| 1454 | b := dAtA[iNdEx] |
| 1455 | iNdEx++ |
| 1456 | wire |= uint64(b&0x7F) << shift |
| 1457 | if b < 0x80 { |
| 1458 | break |
| 1459 | } |
| 1460 | } |
| 1461 | fieldNum := int32(wire >> 3) |
| 1462 | wireType := int(wire & 0x7) |
| 1463 | if wireType == 4 { |
| 1464 | return fmt.Errorf("proto: KVTransfer: wiretype end group for non-group") |
| 1465 | } |
| 1466 | if fieldNum <= 0 { |
| 1467 | return fmt.Errorf("proto: KVTransfer: illegal tag %d (wire type %d)", fieldNum, wire) |
| 1468 | } |
| 1469 | switch fieldNum { |
| 1470 | case 1: |
| 1471 | if wireType != 2 { |
| 1472 | return fmt.Errorf("proto: wrong wireType = %d for field SimpleValue", wireType) |
| 1473 | } |
| 1474 | var byteLen int |
| 1475 | for shift := uint(0); ; shift += 7 { |
| 1476 | if shift >= 64 { |
| 1477 | return protohelpers.ErrIntOverflow |
| 1478 | } |
| 1479 | if iNdEx >= l { |
| 1480 | return io.ErrUnexpectedEOF |
| 1481 | } |
| 1482 | b := dAtA[iNdEx] |
| 1483 | iNdEx++ |
| 1484 | byteLen |= int(b&0x7F) << shift |
| 1485 | if b < 0x80 { |
| 1486 | break |
| 1487 | } |
| 1488 | } |
| 1489 | if byteLen < 0 { |
| 1490 | return protohelpers.ErrInvalidLength |
| 1491 | } |
| 1492 | postIndex := iNdEx + byteLen |
| 1493 | if postIndex < 0 { |
| 1494 | return protohelpers.ErrInvalidLength |
| 1495 | } |
| 1496 | if postIndex > l { |
| 1497 | return io.ErrUnexpectedEOF |
| 1498 | } |
| 1499 | m.SimpleValue = append(m.SimpleValue[:0], dAtA[iNdEx:postIndex]...) |
| 1500 | if m.SimpleValue == nil { |
| 1501 | m.SimpleValue = []byte{} |
| 1502 | } |
| 1503 | iNdEx = postIndex |
| 1504 | case 2: |
| 1505 | if wireType != 2 { |
| 1506 | return fmt.Errorf("proto: wrong wireType = %d for field PrefixChildren", wireType) |
| 1507 | } |
| 1508 | var byteLen int |
| 1509 | for shift := uint(0); ; shift += 7 { |
| 1510 | if shift >= 64 { |
| 1511 | return protohelpers.ErrIntOverflow |
| 1512 | } |
| 1513 | if iNdEx >= l { |
| 1514 | return io.ErrUnexpectedEOF |
| 1515 | } |
| 1516 | b := dAtA[iNdEx] |
| 1517 | iNdEx++ |
| 1518 | byteLen |= int(b&0x7F) << shift |
| 1519 | if b < 0x80 { |
| 1520 | break |
| 1521 | } |
| 1522 | } |
| 1523 | if byteLen < 0 { |
| 1524 | return protohelpers.ErrInvalidLength |
| 1525 | } |
| 1526 | postIndex := iNdEx + byteLen |
| 1527 | if postIndex < 0 { |
| 1528 | return protohelpers.ErrInvalidLength |
| 1529 | } |
| 1530 | if postIndex > l { |
| 1531 | return io.ErrUnexpectedEOF |
| 1532 | } |
| 1533 | m.PrefixChildren = append(m.PrefixChildren, make([]byte, postIndex-iNdEx)) |
| 1534 | copy(m.PrefixChildren[len(m.PrefixChildren)-1], dAtA[iNdEx:postIndex]) |
| 1535 | iNdEx = postIndex |
| 1536 | case 3: |
| 1537 | if wireType != 0 { |
| 1538 | return fmt.Errorf("proto: wrong wireType = %d for field LeaseToken", wireType) |
| 1539 | } |
| 1540 | m.LeaseToken = 0 |
| 1541 | for shift := uint(0); ; shift += 7 { |
| 1542 | if shift >= 64 { |
| 1543 | return protohelpers.ErrIntOverflow |
| 1544 | } |
| 1545 | if iNdEx >= l { |
| 1546 | return io.ErrUnexpectedEOF |
| 1547 | } |
| 1548 | b := dAtA[iNdEx] |
| 1549 | iNdEx++ |
| 1550 | m.LeaseToken |= uint64(b&0x7F) << shift |
| 1551 | if b < 0x80 { |
| 1552 | break |
| 1553 | } |
| 1554 | } |
| 1555 | default: |
| 1556 | iNdEx = preIndex |
| 1557 | skippy, err := protohelpers.Skip(dAtA[iNdEx:]) |
| 1558 | if err != nil { |
| 1559 | return err |
| 1560 | } |
| 1561 | if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 1562 | return protohelpers.ErrInvalidLength |
| 1563 | } |
| 1564 | if (iNdEx + skippy) > l { |
| 1565 | return io.ErrUnexpectedEOF |
| 1566 | } |
| 1567 | m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) |
| 1568 | iNdEx += skippy |
| 1569 | } |
| 1570 | } |
| 1571 | |
| 1572 | if iNdEx > l { |
| 1573 | return io.ErrUnexpectedEOF |
| 1574 | } |
| 1575 | return nil |
| 1576 | } |
| 1577 | func (m *ImportRequest) UnmarshalVT(dAtA []byte) error { |
| 1578 | l := len(dAtA) |
| 1579 | iNdEx := 0 |
| 1580 | for iNdEx < l { |
| 1581 | preIndex := iNdEx |
| 1582 | var wire uint64 |
| 1583 | for shift := uint(0); ; shift += 7 { |
| 1584 | if shift >= 64 { |
| 1585 | return protohelpers.ErrIntOverflow |
| 1586 | } |
| 1587 | if iNdEx >= l { |
| 1588 | return io.ErrUnexpectedEOF |
| 1589 | } |
| 1590 | b := dAtA[iNdEx] |
| 1591 | iNdEx++ |
| 1592 | wire |= uint64(b&0x7F) << shift |
| 1593 | if b < 0x80 { |
| 1594 | break |
| 1595 | } |
| 1596 | } |
| 1597 | fieldNum := int32(wire >> 3) |
| 1598 | wireType := int(wire & 0x7) |
| 1599 | if wireType == 4 { |
| 1600 | return fmt.Errorf("proto: ImportRequest: wiretype end group for non-group") |
| 1601 | } |
| 1602 | if fieldNum <= 0 { |
| 1603 | return fmt.Errorf("proto: ImportRequest: illegal tag %d (wire type %d)", fieldNum, wire) |
| 1604 | } |
| 1605 | switch fieldNum { |
| 1606 | case 1: |
| 1607 | if wireType != 2 { |
| 1608 | return fmt.Errorf("proto: wrong wireType = %d for field Keys", wireType) |
| 1609 | } |
| 1610 | var byteLen int |
| 1611 | for shift := uint(0); ; shift += 7 { |
| 1612 | if shift >= 64 { |
| 1613 | return protohelpers.ErrIntOverflow |
| 1614 | } |
| 1615 | if iNdEx >= l { |
| 1616 | return io.ErrUnexpectedEOF |
| 1617 | } |
| 1618 | b := dAtA[iNdEx] |
| 1619 | iNdEx++ |
| 1620 | byteLen |= int(b&0x7F) << shift |
| 1621 | if b < 0x80 { |
| 1622 | break |
| 1623 | } |
| 1624 | } |
| 1625 | if byteLen < 0 { |
| 1626 | return protohelpers.ErrInvalidLength |
| 1627 | } |
| 1628 | postIndex := iNdEx + byteLen |
| 1629 | if postIndex < 0 { |
| 1630 | return protohelpers.ErrInvalidLength |
| 1631 | } |
| 1632 | if postIndex > l { |
| 1633 | return io.ErrUnexpectedEOF |
| 1634 | } |
| 1635 | m.Keys = append(m.Keys, make([]byte, postIndex-iNdEx)) |
| 1636 | copy(m.Keys[len(m.Keys)-1], dAtA[iNdEx:postIndex]) |
| 1637 | iNdEx = postIndex |
| 1638 | case 2: |
| 1639 | if wireType != 2 { |
| 1640 | return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) |
| 1641 | } |
| 1642 | var msglen int |
| 1643 | for shift := uint(0); ; shift += 7 { |
| 1644 | if shift >= 64 { |
| 1645 | return protohelpers.ErrIntOverflow |
| 1646 | } |
| 1647 | if iNdEx >= l { |
| 1648 | return io.ErrUnexpectedEOF |
| 1649 | } |
| 1650 | b := dAtA[iNdEx] |
| 1651 | iNdEx++ |
| 1652 | msglen |= int(b&0x7F) << shift |
| 1653 | if b < 0x80 { |
| 1654 | break |
| 1655 | } |
| 1656 | } |
| 1657 | if msglen < 0 { |
| 1658 | return protohelpers.ErrInvalidLength |
| 1659 | } |
| 1660 | postIndex := iNdEx + msglen |
| 1661 | if postIndex < 0 { |
| 1662 | return protohelpers.ErrInvalidLength |
| 1663 | } |
| 1664 | if postIndex > l { |
| 1665 | return io.ErrUnexpectedEOF |
| 1666 | } |
| 1667 | m.Values = append(m.Values, &KVTransfer{}) |
| 1668 | if err := m.Values[len(m.Values)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { |
| 1669 | return err |
| 1670 | } |
| 1671 | iNdEx = postIndex |
| 1672 | default: |
| 1673 | iNdEx = preIndex |
| 1674 | skippy, err := protohelpers.Skip(dAtA[iNdEx:]) |
| 1675 | if err != nil { |
| 1676 | return err |
| 1677 | } |
| 1678 | if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 1679 | return protohelpers.ErrInvalidLength |
| 1680 | } |
| 1681 | if (iNdEx + skippy) > l { |
| 1682 | return io.ErrUnexpectedEOF |
| 1683 | } |
| 1684 | m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) |
| 1685 | iNdEx += skippy |
| 1686 | } |
| 1687 | } |
| 1688 | |
| 1689 | if iNdEx > l { |
| 1690 | return io.ErrUnexpectedEOF |
| 1691 | } |
| 1692 | return nil |
| 1693 | } |
| 1694 | func (m *ImportResponse) UnmarshalVT(dAtA []byte) error { |
| 1695 | l := len(dAtA) |
| 1696 | iNdEx := 0 |
| 1697 | for iNdEx < l { |
| 1698 | preIndex := iNdEx |
| 1699 | var wire uint64 |
| 1700 | for shift := uint(0); ; shift += 7 { |
| 1701 | if shift >= 64 { |
| 1702 | return protohelpers.ErrIntOverflow |
| 1703 | } |
| 1704 | if iNdEx >= l { |
| 1705 | return io.ErrUnexpectedEOF |
| 1706 | } |
| 1707 | b := dAtA[iNdEx] |
| 1708 | iNdEx++ |
| 1709 | wire |= uint64(b&0x7F) << shift |
| 1710 | if b < 0x80 { |
| 1711 | break |
| 1712 | } |
| 1713 | } |
| 1714 | fieldNum := int32(wire >> 3) |
| 1715 | wireType := int(wire & 0x7) |
| 1716 | if wireType == 4 { |
| 1717 | return fmt.Errorf("proto: ImportResponse: wiretype end group for non-group") |
| 1718 | } |
| 1719 | if fieldNum <= 0 { |
| 1720 | return fmt.Errorf("proto: ImportResponse: illegal tag %d (wire type %d)", fieldNum, wire) |
| 1721 | } |
| 1722 | switch fieldNum { |
| 1723 | default: |
| 1724 | iNdEx = preIndex |
| 1725 | skippy, err := protohelpers.Skip(dAtA[iNdEx:]) |
| 1726 | if err != nil { |
| 1727 | return err |
| 1728 | } |
| 1729 | if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 1730 | return protohelpers.ErrInvalidLength |
| 1731 | } |
| 1732 | if (iNdEx + skippy) > l { |
| 1733 | return io.ErrUnexpectedEOF |
| 1734 | } |
| 1735 | m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) |
| 1736 | iNdEx += skippy |
| 1737 | } |
| 1738 | } |
| 1739 | |
| 1740 | if iNdEx > l { |
| 1741 | return io.ErrUnexpectedEOF |
| 1742 | } |
| 1743 | return nil |
| 1744 | } |
| 1745 | func (m *ListKeysRequest) UnmarshalVT(dAtA []byte) error { |
| 1746 | l := len(dAtA) |
| 1747 | iNdEx := 0 |
| 1748 | for iNdEx < l { |
| 1749 | preIndex := iNdEx |
| 1750 | var wire uint64 |
| 1751 | for shift := uint(0); ; shift += 7 { |
| 1752 | if shift >= 64 { |
| 1753 | return protohelpers.ErrIntOverflow |
| 1754 | } |
| 1755 | if iNdEx >= l { |
| 1756 | return io.ErrUnexpectedEOF |
| 1757 | } |
| 1758 | b := dAtA[iNdEx] |
| 1759 | iNdEx++ |
| 1760 | wire |= uint64(b&0x7F) << shift |
| 1761 | if b < 0x80 { |
| 1762 | break |
| 1763 | } |
| 1764 | } |
| 1765 | fieldNum := int32(wire >> 3) |
| 1766 | wireType := int(wire & 0x7) |
| 1767 | if wireType == 4 { |
| 1768 | return fmt.Errorf("proto: ListKeysRequest: wiretype end group for non-group") |
| 1769 | } |
| 1770 | if fieldNum <= 0 { |
| 1771 | return fmt.Errorf("proto: ListKeysRequest: illegal tag %d (wire type %d)", fieldNum, wire) |
| 1772 | } |
| 1773 | switch fieldNum { |
| 1774 | case 1: |
| 1775 | if wireType != 2 { |
| 1776 | return fmt.Errorf("proto: wrong wireType = %d for field Prefix", wireType) |
| 1777 | } |
| 1778 | var byteLen int |
| 1779 | for shift := uint(0); ; shift += 7 { |
| 1780 | if shift >= 64 { |
| 1781 | return protohelpers.ErrIntOverflow |
| 1782 | } |
| 1783 | if iNdEx >= l { |
| 1784 | return io.ErrUnexpectedEOF |
| 1785 | } |
| 1786 | b := dAtA[iNdEx] |
| 1787 | iNdEx++ |
| 1788 | byteLen |= int(b&0x7F) << shift |
| 1789 | if b < 0x80 { |
| 1790 | break |
| 1791 | } |
| 1792 | } |
| 1793 | if byteLen < 0 { |
| 1794 | return protohelpers.ErrInvalidLength |
| 1795 | } |
| 1796 | postIndex := iNdEx + byteLen |
| 1797 | if postIndex < 0 { |
| 1798 | return protohelpers.ErrInvalidLength |
| 1799 | } |
| 1800 | if postIndex > l { |
| 1801 | return io.ErrUnexpectedEOF |
| 1802 | } |
| 1803 | m.Prefix = append(m.Prefix[:0], dAtA[iNdEx:postIndex]...) |
| 1804 | if m.Prefix == nil { |
| 1805 | m.Prefix = []byte{} |
| 1806 | } |
| 1807 | iNdEx = postIndex |
| 1808 | default: |
| 1809 | iNdEx = preIndex |
| 1810 | skippy, err := protohelpers.Skip(dAtA[iNdEx:]) |
| 1811 | if err != nil { |
| 1812 | return err |
| 1813 | } |
| 1814 | if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 1815 | return protohelpers.ErrInvalidLength |
| 1816 | } |
| 1817 | if (iNdEx + skippy) > l { |
| 1818 | return io.ErrUnexpectedEOF |
| 1819 | } |
| 1820 | m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) |
| 1821 | iNdEx += skippy |
| 1822 | } |
| 1823 | } |
| 1824 | |
| 1825 | if iNdEx > l { |
| 1826 | return io.ErrUnexpectedEOF |
| 1827 | } |
| 1828 | return nil |
| 1829 | } |
| 1830 | func (m *KeyComposite) UnmarshalVT(dAtA []byte) error { |
| 1831 | l := len(dAtA) |
| 1832 | iNdEx := 0 |
| 1833 | for iNdEx < l { |
| 1834 | preIndex := iNdEx |
| 1835 | var wire uint64 |
| 1836 | for shift := uint(0); ; shift += 7 { |
| 1837 | if shift >= 64 { |
| 1838 | return protohelpers.ErrIntOverflow |
| 1839 | } |
| 1840 | if iNdEx >= l { |
| 1841 | return io.ErrUnexpectedEOF |
| 1842 | } |
| 1843 | b := dAtA[iNdEx] |
| 1844 | iNdEx++ |
| 1845 | wire |= uint64(b&0x7F) << shift |
| 1846 | if b < 0x80 { |
| 1847 | break |
| 1848 | } |
| 1849 | } |
| 1850 | fieldNum := int32(wire >> 3) |
| 1851 | wireType := int(wire & 0x7) |
| 1852 | if wireType == 4 { |
| 1853 | return fmt.Errorf("proto: KeyComposite: wiretype end group for non-group") |
| 1854 | } |
| 1855 | if fieldNum <= 0 { |
| 1856 | return fmt.Errorf("proto: KeyComposite: illegal tag %d (wire type %d)", fieldNum, wire) |
| 1857 | } |
| 1858 | switch fieldNum { |
| 1859 | case 1: |
| 1860 | if wireType != 2 { |
| 1861 | return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) |
| 1862 | } |
| 1863 | var byteLen int |
| 1864 | for shift := uint(0); ; shift += 7 { |
| 1865 | if shift >= 64 { |
| 1866 | return protohelpers.ErrIntOverflow |
| 1867 | } |
| 1868 | if iNdEx >= l { |
| 1869 | return io.ErrUnexpectedEOF |
| 1870 | } |
| 1871 | b := dAtA[iNdEx] |
| 1872 | iNdEx++ |
| 1873 | byteLen |= int(b&0x7F) << shift |
| 1874 | if b < 0x80 { |
| 1875 | break |
| 1876 | } |
| 1877 | } |
| 1878 | if byteLen < 0 { |
| 1879 | return protohelpers.ErrInvalidLength |
| 1880 | } |
| 1881 | postIndex := iNdEx + byteLen |
| 1882 | if postIndex < 0 { |
| 1883 | return protohelpers.ErrInvalidLength |
| 1884 | } |
| 1885 | if postIndex > l { |
| 1886 | return io.ErrUnexpectedEOF |
| 1887 | } |
| 1888 | m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) |
| 1889 | if m.Key == nil { |
| 1890 | m.Key = []byte{} |
| 1891 | } |
| 1892 | iNdEx = postIndex |
| 1893 | case 2: |
| 1894 | if wireType != 0 { |
| 1895 | return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) |
| 1896 | } |
| 1897 | m.Type = 0 |
| 1898 | for shift := uint(0); ; shift += 7 { |
| 1899 | if shift >= 64 { |
| 1900 | return protohelpers.ErrIntOverflow |
| 1901 | } |
| 1902 | if iNdEx >= l { |
| 1903 | return io.ErrUnexpectedEOF |
| 1904 | } |
| 1905 | b := dAtA[iNdEx] |
| 1906 | iNdEx++ |
| 1907 | m.Type |= KeyComposite_Type(b&0x7F) << shift |
| 1908 | if b < 0x80 { |
| 1909 | break |
| 1910 | } |
| 1911 | } |
| 1912 | default: |
| 1913 | iNdEx = preIndex |
| 1914 | skippy, err := protohelpers.Skip(dAtA[iNdEx:]) |
| 1915 | if err != nil { |
| 1916 | return err |
| 1917 | } |
| 1918 | if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 1919 | return protohelpers.ErrInvalidLength |
| 1920 | } |
| 1921 | if (iNdEx + skippy) > l { |
| 1922 | return io.ErrUnexpectedEOF |
| 1923 | } |
| 1924 | m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) |
| 1925 | iNdEx += skippy |
| 1926 | } |
| 1927 | } |
| 1928 | |
| 1929 | if iNdEx > l { |
| 1930 | return io.ErrUnexpectedEOF |
| 1931 | } |
| 1932 | return nil |
| 1933 | } |
| 1934 | func (m *ListKeysResponse) UnmarshalVT(dAtA []byte) error { |
| 1935 | l := len(dAtA) |
| 1936 | iNdEx := 0 |
| 1937 | for iNdEx < l { |
| 1938 | preIndex := iNdEx |
| 1939 | var wire uint64 |
| 1940 | for shift := uint(0); ; shift += 7 { |
| 1941 | if shift >= 64 { |
| 1942 | return protohelpers.ErrIntOverflow |
| 1943 | } |
| 1944 | if iNdEx >= l { |
| 1945 | return io.ErrUnexpectedEOF |
| 1946 | } |
| 1947 | b := dAtA[iNdEx] |
| 1948 | iNdEx++ |
| 1949 | wire |= uint64(b&0x7F) << shift |
| 1950 | if b < 0x80 { |
| 1951 | break |
| 1952 | } |
| 1953 | } |
| 1954 | fieldNum := int32(wire >> 3) |
| 1955 | wireType := int(wire & 0x7) |
| 1956 | if wireType == 4 { |
| 1957 | return fmt.Errorf("proto: ListKeysResponse: wiretype end group for non-group") |
| 1958 | } |
| 1959 | if fieldNum <= 0 { |
| 1960 | return fmt.Errorf("proto: ListKeysResponse: illegal tag %d (wire type %d)", fieldNum, wire) |
| 1961 | } |
| 1962 | switch fieldNum { |
| 1963 | case 1: |
| 1964 | if wireType != 2 { |
| 1965 | return fmt.Errorf("proto: wrong wireType = %d for field Keys", wireType) |
| 1966 | } |
| 1967 | var msglen int |
| 1968 | for shift := uint(0); ; shift += 7 { |
| 1969 | if shift >= 64 { |
| 1970 | return protohelpers.ErrIntOverflow |
| 1971 | } |
| 1972 | if iNdEx >= l { |
| 1973 | return io.ErrUnexpectedEOF |
| 1974 | } |
| 1975 | b := dAtA[iNdEx] |
| 1976 | iNdEx++ |
| 1977 | msglen |= int(b&0x7F) << shift |
| 1978 | if b < 0x80 { |
| 1979 | break |
| 1980 | } |
| 1981 | } |
| 1982 | if msglen < 0 { |
| 1983 | return protohelpers.ErrInvalidLength |
| 1984 | } |
| 1985 | postIndex := iNdEx + msglen |
| 1986 | if postIndex < 0 { |
| 1987 | return protohelpers.ErrInvalidLength |
| 1988 | } |
| 1989 | if postIndex > l { |
| 1990 | return io.ErrUnexpectedEOF |
| 1991 | } |
| 1992 | m.Keys = append(m.Keys, &KeyComposite{}) |
| 1993 | if err := m.Keys[len(m.Keys)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { |
| 1994 | return err |
| 1995 | } |
| 1996 | iNdEx = postIndex |
| 1997 | default: |
| 1998 | iNdEx = preIndex |
| 1999 | skippy, err := protohelpers.Skip(dAtA[iNdEx:]) |
| 2000 | if err != nil { |
| 2001 | return err |
| 2002 | } |
| 2003 | if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 2004 | return protohelpers.ErrInvalidLength |
| 2005 | } |
| 2006 | if (iNdEx + skippy) > l { |
| 2007 | return io.ErrUnexpectedEOF |
| 2008 | } |
| 2009 | m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) |
| 2010 | iNdEx += skippy |
| 2011 | } |
| 2012 | } |
| 2013 | |
| 2014 | if iNdEx > l { |
| 2015 | return io.ErrUnexpectedEOF |
| 2016 | } |
| 2017 | return nil |
| 2018 | } |