provide HandlerEndpoints
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
14
options.go
14
options.go
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user