Added Sync RPC call; it's identical to ListServices for now
This commit is contained in:
@@ -74,3 +74,14 @@ func (r *Registry) Watch(ctx context.Context, req *pb.WatchRequest, rsp pb.Regis
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *Registry) Sync(ctx context.Context, req *pb.SyncRequest, rsp *pb.SyncResponse) error {
|
||||
services, err := r.Registry.ListServices()
|
||||
if err != nil {
|
||||
return errors.InternalServerError("go.micro.registry", err.Error())
|
||||
}
|
||||
for _, srv := range services {
|
||||
rsp.Services = append(rsp.Services, service.ToProto(srv))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user