Copyright © 2007-2010 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.
Behaviours: gen_server.
Authors: Kevin A. Smith (ksmith@basho.com).
hostmatchterm() = {hostmatch(), [pathmatchterm()]}
The dispatch configuration contains a list of these terms, and the first one whose host and one pathmatchterm match is used.
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.
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.
add_route/1 | Adds a route to webmachine's route table. |
remove_resource/1 | Removes all routes for a specific resource module. |
remove_route/1 | Removes a route from webamchine's route table. |
start_link/0 | Starts the webmachine_router gen_server. |
add_route(Route::hostmatchterm() | pathmatchterm()) -> ok
Adds a route to webmachine's route table. The route should be the format documented here: http://bitbucket.org/justin/webmachine/wiki/DispatchConfiguration
remove_resource(Resource::atom()) -> ok
Removes all routes for a specific resource module.
remove_route(Route::hostmatchterm() | pathmatchterm()) -> ok
Removes a route from webamchine's route table. The route route must be properly formatted
See also: add_route/2.
start_link() -> {ok, pid()} | {error, any()}
Starts the webmachine_router gen_server.
Generated by EDoc, Feb 8 2011, 19:14:54.