kv.proto 1.1 KB

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