badgerpb4.proto raw

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