Router
Object Hierarchy:
Description:
[ Version ( since = "0.1" ) ]
public class Router : Handler
Dispatches incoming requests to the appropriate registered handler.
Content:
Properties:
Creation methods:
Methods:
- public void @delete (string rule, owned HandlerCallback cb, string? name = null)
- public void @get (string rule, owned HandlerCallback cb, string? name = null)
- 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)
- 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)
- 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
- @get
- @new
- @ref
- @set
- add_toggle_ref
- add_weak_pointer
- bind_property
- connect
- constructed
- disconnect
- dispose
- dup_data
- dup_qdata
- force_floating
- freeze_notify
- get_class
- get_data
- get_property
- get_qdata
- get_type
- getv
- interface_find_property
- interface_install_property
- interface_list_properties
- is_floating
- new_valist
- new_with_properties
- newv
- notify
- notify_property
- ref_count
- ref_sink
- remove_toggle_ref
- remove_weak_pointer
- replace_data
- replace_qdata
- set_data
- set_data_full
- set_property
- set_qdata
- set_qdata_full
- set_valist
- setv
- steal_data
- steal_qdata
- thaw_notify
- unref
- watch_closure
- weak_ref
- weak_unref