blob: a93479c69f74c790a123a7de5087c73c0451258d [file] [log] [blame]
Abhay Kumar40252eb2025-10-13 13:25:53 +00001syntax = "proto3";
2package mvccpb;
3
4import "gogoproto/gogo.proto";
5
6option go_package = "go.etcd.io/etcd/api/v3/mvccpb";
7
8option (gogoproto.marshaler_all) = true;
9option (gogoproto.sizer_all) = true;
10option (gogoproto.unmarshaler_all) = true;
11option (gogoproto.goproto_getters_all) = false;
12option (gogoproto.goproto_enum_prefix_all) = false;
13
14message KeyValue {
15 // key is the key in bytes. An empty key is not allowed.
16 bytes key = 1;
17 // create_revision is the revision of last creation on this key.
18 int64 create_revision = 2;
19 // mod_revision is the revision of last modification on this key.
20 int64 mod_revision = 3;
21 // version is the version of the key. A deletion resets
22 // the version to zero and any modification of the key
23 // increases its version.
24 int64 version = 4;
25 // value is the value held by the key, in bytes.
26 bytes value = 5;
27 // lease is the ID of the lease that attached to key.
28 // When the attached lease expires, the key will be deleted.
29 // If lease is 0, then no lease is attached to the key.
30 int64 lease = 6;
31}
32
33message Event {
34 enum EventType {
35 PUT = 0;
36 DELETE = 1;
37 }
38 // type is the kind of event. If type is a PUT, it indicates
39 // new data has been stored to the key. If type is a DELETE,
40 // it indicates the key was deleted.
41 EventType type = 1;
42 // kv holds the KeyValue for the event.
43 // A PUT event contains current kv pair.
44 // A PUT event with kv.Version=1 indicates the creation of a key.
45 // A DELETE/EXPIRE event contains the deleted key with
46 // its modification revision set to the revision of deletion.
47 KeyValue kv = 2;
48
49 // prev_kv holds the key-value pair before the event happens.
50 KeyValue prev_kv = 3;
51}