Hi,
I was creating a library which allows creating the basic GRPC server for a client of the library and also running the grpc.Serve method on behalf of the client.
The client of the library provides a function value which performs the Service Registration function. This is passed to the library as a
func(){ /* register service code */ }
However, I felt that before calling
, I should check if the service has been registered by checking the output of
from the GRPC Server which is newly created. If this is nil, then return an error to the client of the library indicating that the service has not been registered and that the client needs to pass in a registration function (which is generated by the protoc compiler)
Is this a good idea to provide this sort of functionality/error handling when exposing GRPC boilerplate (such as creating a listener, GRPC server,etc.) via a custom library package ?
Regards,
N