Fix build breaks

This commit is contained in:
Asim Aslam 2019-09-09 09:25:47 -07:00
parent 1f44d7a4a1
commit 2c16c7e62f

View File

@ -14,40 +14,46 @@ type Registry struct {
Registry registry.Registry Registry registry.Registry
} }
func (r *Registry) GetService(ctx context.Context, req pb.GetRequest, rsp pb.GetResponse) error { func (r *Registry) GetService(ctx context.Context, req *pb.GetRequest, rsp *pb.GetResponse) error {
services, err := r.Registry.GetService(req.Service) services, err := r.Registry.GetService(req.Service)
if err != nil {
return errors.InternalServerError("go.micro.registry", err.Error())
}
for _, srv := range services { for _, srv := range services {
rsp.Services = append(rsp.Services, service.ToProto(srv)) rsp.Services = append(rsp.Services, service.ToProto(srv))
} }
return nil return nil
} }
func (r *Registry) Register(ctx context.Context, req pb.Service, rsp pb.EmptyResponse) error { func (r *Registry) Register(ctx context.Context, req *pb.Service, rsp *pb.EmptyResponse) error {
err := r.Registry.Register(service.ToService(req.Service)) err := r.Registry.Register(service.ToService(req))
if err != nil { if err != nil {
return errors.InternalServerError("go.micro.registry", err.Error()) return errors.InternalServerError("go.micro.registry", err.Error())
} }
return nil return nil
} }
func (r *Registry) Deregister(ctx context.Context, req pb.Service, rsp pb.EmptyResponse) error { func (r *Registry) Deregister(ctx context.Context, req *pb.Service, rsp *pb.EmptyResponse) error {
err := r.Registry.Deregister(service.ToService(req.Service)) err := r.Registry.Deregister(service.ToService(req))
if err != nil { if err != nil {
return errors.InternalServerError("go.micro.registry", err.Error()) return errors.InternalServerError("go.micro.registry", err.Error())
} }
return nil return nil
} }
func (r *Registry) ListServices(ctx context.Context, req pb.ListRequest, rsp pb.ListResponse) error { func (r *Registry) ListServices(ctx context.Context, req *pb.ListRequest, rsp *pb.ListResponse) error {
services, err := r.Registry.ListServices() services, err := r.Registry.ListServices()
if err != nil {
return errors.InternalServerError("go.micro.registry", err.Error())
}
for _, srv := range services { for _, srv := range services {
rsp.Services = append(rsp.Services, service.ToProto(srv)) rsp.Services = append(rsp.Services, service.ToProto(srv))
} }
return nil return nil
} }
func (r *Registry) Watch(ctx context.Context, req pb.WatchRequest, rsp pb.Registry_WatchStream) error { func (r *Registry) Watch(ctx context.Context, req *pb.WatchRequest, rsp pb.Registry_WatchStream) error {
watcher, err := r.Registry.Watcher(registry.WatchOption(req.Service)) watcher, err := r.Registry.Watch(registry.WatchService(req.Service))
if err != nil { if err != nil {
return errors.InternalServerError("go.micro.registry", err.Error()) return errors.InternalServerError("go.micro.registry", err.Error())
} }