badgerpb4.proto 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. * Copyright (C) 2017 Dgraph Labs, Inc. and Contributors
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. // Use protos/gen.sh to generate .pb.go files.
  17. syntax = "proto3";
  18. package badgerpb4;
  19. option go_package = "github.com/dgraph-io/badger/v4/pb";
  20. message KV {
  21. bytes key = 1;
  22. bytes value = 2;
  23. bytes user_meta = 3;
  24. uint64 version = 4;
  25. uint64 expires_at = 5;
  26. bytes meta = 6;
  27. // Stream id is used to identify which stream the KV came from.
  28. uint32 stream_id = 10;
  29. // Stream done is used to indicate end of stream.
  30. bool stream_done = 11;
  31. }
  32. message KVList {
  33. repeated KV kv = 1;
  34. // alloc_ref used internally for memory management.
  35. uint64 alloc_ref = 10;
  36. }
  37. message ManifestChangeSet {
  38. // A set of changes that are applied atomically.
  39. repeated ManifestChange changes = 1;
  40. }
  41. enum EncryptionAlgo {
  42. aes = 0;
  43. }
  44. message ManifestChange {
  45. uint64 Id = 1; // Table ID.
  46. enum Operation {
  47. CREATE = 0;
  48. DELETE = 1;
  49. }
  50. Operation Op = 2;
  51. uint32 Level = 3; // Only used for CREATE.
  52. uint64 key_id = 4;
  53. EncryptionAlgo encryption_algo = 5;
  54. uint32 compression = 6; // Only used for CREATE Op.
  55. }
  56. message Checksum {
  57. enum Algorithm {
  58. CRC32C = 0;
  59. XXHash64 = 1;
  60. }
  61. Algorithm algo = 1; // For storing type of Checksum algorithm used
  62. uint64 sum = 2;
  63. }
  64. message DataKey {
  65. uint64 key_id = 1;
  66. bytes data = 2;
  67. bytes iv = 3;
  68. int64 created_at = 4;
  69. }
  70. message Match {
  71. bytes prefix = 1;
  72. string ignore_bytes = 2; // Comma separated with dash to represent ranges "1, 2-3, 4-7, 9"
  73. }