kv.proto 883 B

123456789101112131415161718192021222324252627282930313233343536
  1. syntax = "proto3";
  2. package storagepb;
  3. import "github.com/gogo/protobuf/gogoproto/gogo.proto";
  4. option (gogoproto.marshaler_all) = true;
  5. option (gogoproto.sizer_all) = true;
  6. option (gogoproto.unmarshaler_all) = true;
  7. option (gogoproto.goproto_getters_all) = false;
  8. option (gogoproto.goproto_enum_prefix_all) = false;
  9. message KeyValue {
  10. bytes key = 1;
  11. // mod_index is the last modified index of the key.
  12. int64 create_index = 2;
  13. int64 mod_index = 3;
  14. // version is the version of the key. A deletion resets
  15. // the version to zero and any modification of the key
  16. // increases its version.
  17. int64 version = 4;
  18. bytes value = 5;
  19. }
  20. message Event {
  21. enum EventType {
  22. PUT = 0;
  23. DELETE = 1;
  24. EXPIRE = 2;
  25. }
  26. EventType type = 1;
  27. // a put event contains the current key-value
  28. // a delete/expire event contains the previous
  29. // key-value
  30. KeyValue kv = 2;
  31. }