mirror of
https://github.com/valitydev/machinery-erlang.git
synced 2024-11-06 00:35:19 +00:00
OPS-161: Provide simpler get_handler/1
in modernizer backend (#12)
This commit is contained in:
parent
dc899e245b
commit
19cdc6c846
@ -64,6 +64,7 @@
|
||||
-export([new/2]).
|
||||
-export([get_routes/2]).
|
||||
-export([get_handler/2]).
|
||||
-export([get_handler/1]).
|
||||
|
||||
%% Machinery backend
|
||||
-behaviour(machinery_modernizer_backend).
|
||||
@ -82,7 +83,11 @@ get_routes(Handlers, Opts) ->
|
||||
machinery_utils:get_woody_routes(Handlers, fun get_handler/2, Opts).
|
||||
|
||||
-spec get_handler(handler(), machinery_utils:route_opts()) -> machinery_utils:woody_handler().
|
||||
get_handler(#{path := Path, backend_config := Config}, _) ->
|
||||
get_handler(Handler, _) ->
|
||||
get_handler(Handler).
|
||||
|
||||
-spec get_handler(handler()) -> machinery_utils:woody_handler().
|
||||
get_handler(#{path := Path, backend_config := Config}) ->
|
||||
{Path, {
|
||||
{mg_proto_state_processing_thrift, 'Modernizer'},
|
||||
{?MODULE, Config}
|
||||
|
Loading…
Reference in New Issue
Block a user