Copyright © 2007-2009 Basho Technologies Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Authors: Robert Ahrens (rahrens@basho.com), Justin Sheehy (justin@basho.com).
approot() = string()
bindings() = [{bindingterm(), pathtoken()}]
This is a proplist of bindings indicated by atom terms in the matching spec, bound to the matching tokens in the request path.
dispfail() = {no_dispatch_match, pathtokens()}
dispterm() = {matchmod(), matchopts(), pathtokens(), bindings(), approot(), stringpath()}
hostmatch() = [hostterm()] | {[hostterm()], portterm()}
A host header (Host, X-Forwarded-For, etc.) will be matched against this term. Using a raws [hostterm()] list is equivalent to using {[hostterm()], '*'}.
hostmatchterm() = {hostmatch(), [pathmatchterm()]}
The dispatch configuration contains a list of these terms, and the first one whose host and one pathmatchterm match is used.
hostterm() = '*' | string() | atom()
A list of hostterms is matched against a '.'-separated hostname. The '*' hosterm matches all remaining tokens, and is only allowed at the head of the list. A string hostterm will match a token of exactly the same string. Any atom hostterm other than '*' will match any token and will create a binding in the result if a complete match occurs.
matchmod() = atom()
This atom, if present in a successful matchterm, will appear in the resulting dispterm. In Webmachine this is used to name the resource module that will handle the matching request.
matchopts() = [term()]
This term, if present in a successful matchterm, will appear in the resulting dispterm. In Webmachine this is used to provide arguments to the resource module handling the matching request.
matchterm() = hostmatchterm() | pathmatchterm()
The dispatch configuration is a list of these terms, and the first one whose host and path terms match the input is used. Using a pathmatchterm() here is equivalent to using a hostmatchterm() of the form {{['*'],'*'}, [pathmatchterm()]}.
pathmatchterm() = {[pathterm()], matchmod(), matchopts()}
The dispatch configuration contains a list of these terms, and the first one whose list of pathterms matches the input path is used.
pathterm() = '*' | string() | atom()
A list of pathterms is matched against a '/'-separated input path. The '*' pathterm matches all remaining tokens. A string pathterm will match a token of exactly the same string. Any atom pathterm other than '*' will match any token and will create a binding in the result if a complete match occurs.
pathtoken() = string()
pathtokens() = [pathtoken()]
This is the list of tokens matched by a trailing '*' pathterm.
portterm() = '*' | integer() | atom()
A portterm is matched against the integer port after any ':' in the hostname, or 80 if no port is found. The '*' portterm patches any port An integer portterm will match a port of exactly the same integer. Any atom portterm other than '*' will match any port and will create a binding in the result if a complete match occurs.
stringpath() = string()
This is the path portion matched by a trailing '*' pathterm.
dispatch/2 | Interface for URL dispatching. |
dispatch/3 | Interface for URL dispatching. |
dispatch(Path::string(), DispatchList::[matchterm()]) -> dispterm() | dispfail()
Interface for URL dispatching. See also http://bitbucket.org/justin/webmachine/wiki/DispatchConfiguration
dispatch(Host::string(), Path::string(), DispatchList::[matchterm()]) -> dispterm() | dispfail()
Interface for URL dispatching. See also http://bitbucket.org/justin/webmachine/wiki/DispatchConfiguration
Generated by EDoc, Feb 8 2011, 19:14:54.