*: support watch with filters

Now user can filter events with types. The API is also extensible.
It might make sense for the proxy to filter out events based on
more expensive/customized filter.
This commit is contained in:
Xiang Li
2016-06-27 12:20:36 -07:00
parent aab905f7cc
commit dced92f8bd
8 changed files with 459 additions and 215 deletions

View File

@ -181,6 +181,15 @@
],
"default": "KEY"
},
"WatchCreateRequestFilterType": {
"type": "string",
"enum": [
"NOPUT",
"NODELETE"
],
"default": "NOPUT",
"description": "- NOPUT: filter out put event.\n - NODELETE: filter out delete event."
},
"authpbPermission": {
"type": "object",
"properties": {
@ -1171,6 +1180,13 @@
"etcdserverpbWatchCreateRequest": {
"type": "object",
"properties": {
"filters": {
"type": "array",
"items": {
"$ref": "#/definitions/WatchCreateRequestFilterType"
},
"description": "filters filter the events at server side before it sends back to the watcher."
},
"key": {
"type": "string",
"format": "byte",