Router
Object Hierarchy:
Description:
Dispatches incoming requests to the appropriate registered handler.
Namespace: Valum
Package: valum-0.3
Content:
Properties:
Creation methods:
- public Router ()
Methods:
- public void @delete (string rule, owned HandlerCallback cb, string? name = null)
- public void @get (string rule, owned HandlerCallback cb, string? name = null)
Since the Valum.Method.GET flag is used, 'HEAD' will be provided as well.
- public void asterisk (Method method, owned HandlerCallback cb)
Bind a callback to handle asterisk '*' URI.
- public void connect (string rule, owned HandlerCallback cb, string? name = null)
- public override bool handle (Request req, Response res) throws Error
Perform the routing of a pair of request and response objects.
- public void head (string rule, owned HandlerCallback cb, string? name = null)
- public void matcher (Method method, owned MatcherCallback matcher, owned HandlerCallback cb)
Bind a callback to a given method and a matcher callback.
- public void once (owned HandlerCallback cb)
- public void options (string rule, owned HandlerCallback cb, string? name = null)
- public void patch (string rule, owned HandlerCallback cb, string? name = null)
- public void path (Method method, string path, owned HandlerCallback handler, string? name = null)
Bind a callback to a given method and path.
- public void post (string rule, owned HandlerCallback cb, string? name = null)
- public void put (string rule, owned HandlerCallback cb, string? name = null)
- public void regex (Method method, Regex regex, owned HandlerCallback cb)
Bind a callback to a given method and regular expression.
- public void register_type (string name, Regex pattern)
Register a type to be understood by Valum.RuleRoute.
- public void route (Route route, string? name = null)
Append a Route object on the routing sequence.
- public void rule (Method method, string rule, owned HandlerCallback cb, string? name = null)
Bind a callback to a given method and rule.
- public void scope (string fragment, owned LoaderCallback loader)
Add a fragment to the scope stack and nest a router in this new environment.
- public void trace (string rule, owned HandlerCallback cb, string? name = null)
- public string url_for (string name, ...)
Reverse an URL for a named Valum.Route using varidic arguments.
- public string url_for_hash (string name, HashTable<string,string>? @params = null)
Reverse an URL for a named Valum.Route.
- public string url_for_valist (string name, va_list list)
Reverse an URL for a named Valum.Route using a varidic arguments list.
- public void use (owned HandlerCallback cb)
Mount a handling middleware on the routing queue.
Fields:
Inherited Members:
All known members inherited from class VSGI.Handler
All known members inherited from class GLib.Object