gen_router v0.1.2 GenRouter
Router to parse messages, modeled by the idea of simplified Plug.Conn router.
Link to this section Summary
Functions
Custom router factory
Defines default route or a route inside a pipeline
Match specific route in scope of routes
Defines a pipeline to send the connection through
Defines a plug pipeline
Defines a plug inside a pipeline
Defines scope of routers with pipelines
Link to this section Functions
__using__(opts) (macro)
Custom router factory
match(path, controller, action) (macro)
Defines default route or a route inside a pipeline.
See pipeline/2
for more information.
match_in_scope(router_module, scope, routes, scope_pipeline, path_suffix, conn, opts)
match_in_scope(
module(),
atom(),
[{String.t(), atom(), atom()}],
[atom()],
String.t(),
GenRouter.Conn.t(),
Keyword.t()
) :: GenRouter.Conn.t()
match_in_scope( module(), atom(), [{String.t(), atom(), atom()}], [atom()], String.t(), GenRouter.Conn.t(), Keyword.t() ) :: GenRouter.Conn.t()
Match specific route in scope of routes.
We ensure that all paths and suffixs are matched with slash for consistency.
pipe_through(pipes) (macro)
Defines a pipeline to send the connection through.
See pipeline/2
for more information.
pipeline(pipe, list) (macro)
Defines a plug pipeline.
Pipelines are defined at the router root and can be used from any scope.
plug(plug, opts \\ []) (macro)
Defines a plug inside a pipeline.
See pipeline/2
for more information.
scope(scope, scope_path, list) (macro)
Defines scope of routers with pipelines.