magellan_microservice v0.1.9 MagellanMicroservice.Router
This module is used by the server to provide the default routes to status and health page.
Via the register_router/0
function, one can add a custom router to expand the functionality.
Summary
Functions
Callback implementation for c:Plug.call/2
This function gets invoked by the start_link function.
It registers its status function status/0
and starts an Agent :router
which can store a custom router
This funtion enables you to register your own router. All requests that don’t match the configured status and health url will be send to the specified router. Refer to the examples in the Readme in order to use your own router with this microservice
Ths function gets invoked by MagellanMicroservice.AppStatus.get_status/0
and MagellanMicroservice.AppStatus.get_health/0.
It returns the current status of the module
Functions
Specs
init([]) :: any
This function gets invoked by the start_link function.
It registers its status function status/0
and starts an Agent :router
which can store a custom router.
Specs
register_router(any) :: atom
This funtion enables you to register your own router. All requests that don’t match the configured status and health url will be send to the specified router. Refer to the examples in the Readme in order to use your own router with this microservice.
Specs
status :: %{optional(atom) => atom}
Ths function gets invoked by MagellanMicroservice.AppStatus.get_status/0
and MagellanMicroservice.AppStatus.get_health/0.
It returns the current status of the module.