aboutsummaryrefslogtreecommitdiff
path: root/pb/dns.proto
diff options
context:
space:
mode:
authorGravatar John Belamaric <jbelamaric@infoblox.com> 2018-06-27 07:45:32 -0700
committerGravatar GitHub <noreply@github.com> 2018-06-27 07:45:32 -0700
commit99287d091c2db4028e54782fd4de43f63ca4b040 (patch)
tree5e9908031dbf3256a0ad3e2a54c0a90251e88757 /pb/dns.proto
parentb7480d5d1216aa87d80d240a31de750079eba904 (diff)
downloadcoredns-99287d091c2db4028e54782fd4de43f63ca4b040.tar.gz
coredns-99287d091c2db4028e54782fd4de43f63ca4b040.tar.zst
coredns-99287d091c2db4028e54782fd4de43f63ca4b040.zip
Watch feature (#1527)
* Add part 1 watch functionality. (squashed) * add funcs for service/endpoint fqdns * add endpoints watch * document exposed funcs * only send subset deltas * locking for watch map * tests and docs * add pod watch * remove debugs prints * feedback part 1 * add error reporting to proto * inform clients of server stop+errors * add grpc options param * use proper context * Review feedback: * Removed client (will move to another repo) * Use new log functions * Change watchChan to be for string not []string * Rework how k8s plugin stores watch tracking info to simplify * Normalize the qname on watch request * Add blank line back * Revert another spurious change * Fix tests * Add stop channel. Fix tests. Better docs for plugin interface. * fmt.Printf -> log.Warningf * Move from dnsserver to plugin/pkg/watch * gofmt * remove dead client watches * sate linter * linter omg
Diffstat (limited to 'pb/dns.proto')
-rw-r--r--pb/dns.proto37
1 files changed, 37 insertions, 0 deletions
diff --git a/pb/dns.proto b/pb/dns.proto
index 8461f01e6..e4ac2eb2c 100644
--- a/pb/dns.proto
+++ b/pb/dns.proto
@@ -9,4 +9,41 @@ message DnsPacket {
service DnsService {
rpc Query (DnsPacket) returns (DnsPacket);
+ rpc Watch (stream WatchRequest) returns (stream WatchResponse);
+}
+
+message WatchRequest {
+ // request_union is a request to either create a new watcher or cancel an existing watcher.
+ oneof request_union {
+ WatchCreateRequest create_request = 1;
+ WatchCancelRequest cancel_request = 2;
+ }
+}
+
+message WatchCreateRequest {
+ DnsPacket query = 1;
+}
+
+message WatchCancelRequest {
+ // watch_id is the watcher id to cancel
+ int64 watch_id = 1;
+}
+
+message WatchResponse {
+ // watch_id is the ID of the watcher that corresponds to the response.
+ int64 watch_id = 1;
+
+ // created is set to true if the response is for a create watch request.
+ // The client should record the watch_id and expect to receive DNS replies
+ // from the same stream.
+ // All replies sent to the created watcher will attach with the same watch_id.
+ bool created = 2;
+
+ // canceled is set to true if the response is for a cancel watch request.
+ // No further events will be sent to the canceled watcher.
+ bool canceled = 3;
+
+ string qname = 4;
+
+ string err = 5;
}