*: update watch related proto

1. Add watch/cancel request
2. Add necessary fields in response to return watch error
3. Add watch_id into watch response
This commit is contained in:
Xiang Li
2015-12-31 22:28:54 -08:00
parent 7dd599b69d
commit ac330bb7c9
5 changed files with 477 additions and 30 deletions

View File

@ -74,9 +74,9 @@ func watchCommandFunc(cmd *cobra.Command, args []string) {
var r *pb.WatchRequest
switch segs[0] {
case "watch":
r = &pb.WatchRequest{Key: []byte(segs[1])}
r = &pb.WatchRequest{CreateRequest: &pb.WatchCreateRequest{Key: []byte(segs[1])}}
case "watchprefix":
r = &pb.WatchRequest{Prefix: []byte(segs[1])}
r = &pb.WatchRequest{CreateRequest: &pb.WatchCreateRequest{Prefix: []byte(segs[1])}}
default:
fmt.Fprintf(os.Stderr, "Invalid watch request format: use watch key or watchprefix prefix\n")
continue