little-cui commented on a change in pull request #532: Issues-531 add
registration and discovery for client
URL:
https://github.com/apache/servicecomb-service-center/pull/532#discussion_r256676890
##########
File path: pkg/client/sc/watch.go
##########
@@ -0,0 +1,47 @@
+package sc
+
+import (
+ "context"
+ "encoding/json"
+ "fmt"
+ "log"
+
+ "github.com/apache/servicecomb-service-center/server/core"
+ pb "github.com/apache/servicecomb-service-center/server/core/proto"
+ scerr "github.com/apache/servicecomb-service-center/server/error"
+ "github.com/gorilla/websocket"
+)
+
+const (
+ apiWatcherURL = "/v4/%s/registry/microservices/%s/watcher"
+ apiListAndWatcherURL = "/v4/%s/registry/microservices/%s/listwatcher"
+)
+
+func (c *SCClient) Watch(ctx context.Context, domainProject, serviceId string,
callback func(*pb.WatchInstanceResponse)) *scerr.Error {
Review comment:
please rename the serviceId to selfServiceId, because it is not the target
serviceId here
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services