Skip to content

Commit

Permalink
server: Add ServiceRegistrar interface. (#3816)
Browse files Browse the repository at this point in the history
  • Loading branch information
easwars committed Aug 14, 2020
1 parent 1dbe29f commit f30caa9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions server.go
Expand Up @@ -540,6 +540,18 @@ func (s *Server) errorf(format string, a ...interface{}) {
}
}

// ServiceRegistrar wraps a single method that supports service registration. It
// enables users to pass concrete types other than grpc.Server to the service
// registration methods exported by the IDL generated code.
type ServiceRegistrar interface {
// RegisterService registers a service and its implementation to the
// concrete type implementing this interface. It may not be called
// once the server has started serving.
// desc describes the service and its methods and handlers. impl is the
// service implementation which is passed to the method handlers.
RegisterService(desc *ServiceDesc, impl interface{})
}

// RegisterService registers a service and its implementation to the gRPC
// server. It is called from the IDL generated code. This must be called before
// invoking Serve.
Expand Down

0 comments on commit f30caa9

Please sign in to comment.