badgerpb4.proto 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * SPDX-FileCopyrightText: © Hypermode Inc. <hello@hypermode.com>
  3. * SPDX-License-Identifier: Apache-2.0
  4. */
  5. // Use protos/gen.sh to generate .pb.go files.
  6. syntax = "proto3";
  7. package badgerpb4;
  8. option go_package = "github.com/dgraph-io/badger/v4/pb";
  9. message KV {
  10. bytes key = 1;
  11. bytes value = 2;
  12. bytes user_meta = 3;
  13. uint64 version = 4;
  14. uint64 expires_at = 5;
  15. bytes meta = 6;
  16. // Stream id is used to identify which stream the KV came from.
  17. uint32 stream_id = 10;
  18. // Stream done is used to indicate end of stream.
  19. bool stream_done = 11;
  20. }
  21. message KVList {
  22. repeated KV kv = 1;
  23. // alloc_ref used internally for memory management.
  24. uint64 alloc_ref = 10;
  25. }
  26. message ManifestChangeSet {
  27. // A set of changes that are applied atomically.
  28. repeated ManifestChange changes = 1;
  29. }
  30. enum EncryptionAlgo {
  31. aes = 0;
  32. }
  33. message ManifestChange {
  34. uint64 Id = 1; // Table ID.
  35. enum Operation {
  36. CREATE = 0;
  37. DELETE = 1;
  38. }
  39. Operation Op = 2;
  40. uint32 Level = 3; // Only used for CREATE.
  41. uint64 key_id = 4;
  42. EncryptionAlgo encryption_algo = 5;
  43. uint32 compression = 6; // Only used for CREATE Op.
  44. }
  45. message Checksum {
  46. enum Algorithm {
  47. CRC32C = 0;
  48. XXHash64 = 1;
  49. }
  50. Algorithm algo = 1; // For storing type of Checksum algorithm used
  51. uint64 sum = 2;
  52. }
  53. message DataKey {
  54. uint64 key_id = 1;
  55. bytes data = 2;
  56. bytes iv = 3;
  57. int64 created_at = 4;
  58. }
  59. message Match {
  60. bytes prefix = 1;
  61. string ignore_bytes = 2; // Comma separated with dash to represent ranges "1, 2-3, 4-7, 9"
  62. }