Stopsel.Router (stopsel v0.1.0) View Source
This module is responsible for managing the active routes of a router.
A router must first be loaded, before it can be used.
iex> Stopsel.Router.load_router(MyApp.Router)
:okAfter that we can use unload routes, enable them again or even unload the whole router.
iex> Stopsel.Router.unload_route(MyApp.Router, ~w"hello")
:ok
iex> Stopsel.Router.load_route(MyApp.Router, ~w"hello")
:ok
iex> Stopsel.Router.unload_router(MyApp.Router)
:ok
Link to this section Summary
Functions
Loads one route that was previously removed back into the router.
Loads all commands from the given module into the router.
Tries to find a matching route in the given router.
Returns a list of all the currently active routes of the router.
Unloads one route from the router.
Removes the given module from the router.
Link to this section Types
Link to this section Functions
Specs
Loads one route that was previously removed back into the router.
Specs
load_router(router()) :: true
Loads all commands from the given module into the router.
Reloads all routes of the router, if they have been unloaded.
Specs
match_route(router(), path()) :: {:ok, match()} | {:error, match_error()}
Tries to find a matching route in the given router.
Specs
Returns a list of all the currently active routes of the router.
Specs
Unloads one route from the router.
Specs
Removes the given module from the router.