server: Add ServiceRegistrar interface. (#3816)
This commit is contained in:

committed by
GitHub

parent
1dbe29f669
commit
f30caa90ad
12
server.go
12
server.go
@ -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
|
// RegisterService registers a service and its implementation to the gRPC
|
||||||
// server. It is called from the IDL generated code. This must be called before
|
// server. It is called from the IDL generated code. This must be called before
|
||||||
// invoking Serve.
|
// invoking Serve.
|
||||||
|
Reference in New Issue
Block a user