add ability to register RPC endpoint

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2021-07-14 13:43:45 +03:00
parent 26e34124e0
commit c1e0ce26b5
3 changed files with 32 additions and 0 deletions

View File

@@ -110,3 +110,10 @@ func ContentTypeHandler(ct string, h http.HandlerFunc) server.Option {
o.Context = context.WithValue(o.Context, contentTypeHandlerKey{}, v)
}
}
type registerRPCHandlerKey struct{}
// RegisterRPCHandler registers compatibility endpoints with /ServiceName.ServiceEndpoint method POST
func RegisterRPCHandler(b bool) server.Option {
return server.SetOption(registerRPCHandlerKey{}, b)
}