Dispatch notifications¶
content_types_dispatch¶
Get available content types and their dispatch rules Example: {“text/html”, page} A special dispatch rule is ‘page_url’, which refers to the page_url property of the resource.
- Type:
- foldr
- Return:
[{ContentType, DispatchRule}]#content_types_dispatch{}properties:- id:
m_rsc:resource()
- id:
dispatch_host¶
Try to find the site for the request Called when the request Host doesn’t match any active site.
- Type:
- first
- Return:
{ok, #dispatch_redirect{}}orundefined#dispatch_host{}properties:- host:
binary - path:
binary - method:
binary - protocol:
union
- host:
dispatch_match¶
Final try for dispatch, try to match the request. Called when the site is known, but no match is found for the path
- Type:
- first
- Return:
{ok, RscId::integer()},{ok, #dispatch_match{}},{ok, #dispatch_redirect{}}orundefined#dispatch_match{}properties:- dispatch_name:
atom - mod:
atom - mod_opts:
list - path_tokens:
list - bindings:
list
- dispatch_name:
dispatch_redirect¶
Final try for dispatch, try to match the request. Called when the site is known, but no match is found for the path
- Type:
- first
- Return:
{ok, RscId::integer()},{ok, #dispatch_match{}},{ok, #dispatch_redirect{}}orundefined#dispatch_redirect{}properties:- location:
binary - is_permanent:
boolean
- location:
dispatch_rewrite¶
Rewrite a URL before it will be dispatched using the z_sites_dispatcher
- Type:
- foldl
Return:
#dispatch_rewrite{}properties:- is_dir:
boolean - path:
string - host:
unknown
- is_dir:
page_url¶
Fetch the url of a resource’s html representation
- Type:
- first
- Return:
{ok, Url}orundefined#page_url{}properties:- id:
unknown - is_a:
unknown
- id: