Elixir-style route patterns for generated and dynamic Astral routes.
Patterns use Plug/Phoenix-inspired path parameters in Elixir APIs:
/blog/:slug
/blog/*page
/tags/:tag/*page:name captures one path segment. *name captures the rest of the path and
must be the last segment. A missing glob is allowed, which makes patterns like
/blog/*page useful for pagination where page one lives at /blog and later
pages live at /blog/2, /blog/3, and so on.
Summary
Functions
Generate a concrete route path from a pattern and params.
Match a concrete path against a pattern and return string-keyed captured params.
Return true when a concrete path matches a pattern.
Normalize route params to string keys.
Parse a route pattern.
Types
Functions
Generate a concrete route path from a pattern and params.
@spec match(String.t() | t(), String.t()) :: {:ok, %{required(String.t()) => String.t() | nil}} | :error
Match a concrete path against a pattern and return string-keyed captured params.
Return true when a concrete path matches a pattern.
Normalize route params to string keys.
Parse a route pattern.