provide HandlerEndpoints

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2023-02-21 23:56:07 +03:00
parent 4341600c01
commit eea8ae605b
2 changed files with 61 additions and 3 deletions

View File

@@ -133,10 +133,18 @@ func RegisterRPCHandler(b bool) server.Option {
return server.SetOption(registerRPCHandlerKey{}, b)
}
type handlerMetadataKey struct{}
type handlerEndpointsKey struct{}
func HandlerMetadata(md map[string]map[string]map[string]string) server.HandlerOption {
return server.SetHandlerOption(handlerMetadataKey{}, md)
type EndpointMetadata struct {
Name string
Path string
Method string
Body string
Stream bool
}
func HandlerEndpoints(md []EndpointMetadata) server.HandlerOption {
return server.SetHandlerOption(handlerEndpointsKey{}, md)
}
type handlerOptions struct {