spotter v0.1.1 Spotter.Router
Router struct that handles the endpoints and makes dispatching.
Link to this section Summary
Functions
Defines the router struct
Returns an endpoint that matches to the path
argument. Otherwise returns nil
Creates a new router based on the list of tuples. Each tuples represent an endpoints, that required for pre-processing and validating
Link to this section Functions
Defines the router struct.
- :endpoints - List of endpoints, where each endpoint represented as the
Spotter.Endpoint.Plain
or theSpotter.Endpoint.Dynamic
or a Used Defined structure, derived from theSpotter.Endpoint.Base
.
Link to this function
dispatch(router, path)
dispatch(router :: Spotter.Router, path :: Strint.t()) :: dispatch_result()
Returns an endpoint that matches to the path
argument. Otherwise returns nil
.
Link to this function
new(endpoints)
new(endpoints :: [default_endpoint_args() | custom_endpoint_args()]) :: Spotter.Router
Creates a new router based on the list of tuples. Each tuples represent an endpoints, that required for pre-processing and validating.