View Source Maverick.Route (Maverick v0.3.0)
A struct detailing a Maverick Route. The contents are determined at compile time by the annotations applied to routable functions.
Maverick uses the routes to construct request handlers for each routable function at runtime.
Link to this section Summary
Functions
Takes an OTP app name and a root scope and returns a list of all routes the app defines as %MODULE structs.
Link to this section Types
@type args() :: :params | :request | {:required_params, [atom()]}
@type error_code() :: non_neg_integer()
@type method() :: binary()
@type success_code() :: non_neg_integer()
@type t() :: %Maverick.Route{ args: args(), error_code: error_code(), function: atom(), method: method(), module: module(), path: Maverick.Path.path(), raw_path: Maverick.Path.raw_path(), success_code: success_code() }
Link to this section Functions
@spec list_routes(Maverick.otp_app(), Maverick.root_scope()) :: [t()]
Takes an OTP app name and a root scope and returns a list of all routes the app defines as %MODULE structs.