kv.proto 1007 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. syntax = "proto3";
  2. package storagepb;
  3. import "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. int64 create_revision = 2;
  12. // mod_revision is the last modified revision of the key.
  13. int64 mod_revision = 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. // lease is the ID of the lease that attached to key.
  20. // When the attached lease expires, the key will be deleted.
  21. int64 lease = 6;
  22. }
  23. message Event {
  24. enum EventType {
  25. PUT = 0;
  26. DELETE = 1;
  27. EXPIRE = 2;
  28. }
  29. EventType type = 1;
  30. // a put event contains the current key-value
  31. // a delete/expire event contains the previous
  32. // key-value
  33. KeyValue kv = 2;
  34. }