etcd/api/mvccpb/kv.proto

50 lines
1.6 KiB
Protocol Buffer
Raw Normal View History

2015-06-30 04:37:52 +03:00
syntax = "proto3";
2016-04-25 22:32:58 +03:00
package mvccpb;
2015-05-19 00:35:10 +03:00
import "gogoproto/gogo.proto";
2015-05-19 00:35:10 +03:00
option (gogoproto.marshaler_all) = true;
option (gogoproto.sizer_all) = true;
option (gogoproto.unmarshaler_all) = true;
option (gogoproto.goproto_getters_all) = false;
option (gogoproto.goproto_enum_prefix_all) = false;
message KeyValue {
// key is the key in bytes. An empty key is not allowed.
2015-06-30 04:37:52 +03:00
bytes key = 1;
// create_revision is the revision of last creation on this key.
2015-09-04 00:45:54 +03:00
int64 create_revision = 2;
// mod_revision is the revision of last modification on this key.
2015-09-04 00:45:54 +03:00
int64 mod_revision = 3;
2015-05-19 00:35:10 +03:00
// version is the version of the key. A deletion resets
// the version to zero and any modification of the key
// increases its version.
2015-06-30 04:37:52 +03:00
int64 version = 4;
// value is the value held by the key, in bytes.
2015-06-30 04:37:52 +03:00
bytes value = 5;
2015-12-29 22:49:00 +03:00
// lease is the ID of the lease that attached to key.
// When the attached lease expires, the key will be deleted.
// If lease is 0, then no lease is attached to the key.
2015-12-29 22:49:00 +03:00
int64 lease = 6;
2015-05-19 00:35:10 +03:00
}
message Event {
enum EventType {
PUT = 0;
DELETE = 1;
}
// type is the kind of event. If type is a PUT, it indicates
// new data has been stored to the key. If type is a DELETE,
// it indicates the key was deleted.
2015-06-30 04:37:52 +03:00
EventType type = 1;
// kv holds the KeyValue for the event.
// A PUT event contains current kv pair.
// A PUT event with kv.Version=1 indicates the creation of a key.
// A DELETE/EXPIRE event contains the deleted key with
// its modification revision set to the revision of deletion.
2015-06-30 04:37:52 +03:00
KeyValue kv = 2;
2016-07-02 05:17:01 +03:00
// prev_kv holds the key-value pair before the event happens.
KeyValue prev_kv = 3;
2015-05-19 00:35:10 +03:00
}