Router
Object Hierarchy:
Description:
public class Router :
Handler
Dispatches incoming requests to the appropriate registered handler.
Content:
Properties:
Creation methods:
Methods:
- public void register_type (string name, Regex pattern)
- public void once (owned HandlerCallback cb)
- public void use (owned HandlerCallback cb)
Mount a handling middleware on the routing queue.
- public void asterisk (Method method, owned HandlerCallback cb)
Bind a callback to handle asterisk '*' URI.
- public void @get (string rule, owned HandlerCallback cb, string? name = null)
- public void post (string rule, owned HandlerCallback cb, string? name = null)
- public void put (string rule, owned HandlerCallback cb, string? name = null)
- public void @delete (string rule, owned HandlerCallback cb, string? name = null)
- public void head (string rule, owned HandlerCallback cb, string? name = null)
- public void options (string rule, owned HandlerCallback cb, string? name = null)
- public void trace (string rule, owned HandlerCallback cb, string? name = null)
- public void connect (string rule, owned HandlerCallback cb, string? name = null)
- public void patch (string rule, owned HandlerCallback cb, string? name = null)
- public void rule (Method method, string rule, owned HandlerCallback cb, string? name = null)
Bind a callback to a given method and rule.
- public void regex (Method method, Regex regex, owned HandlerCallback cb)
Bind a callback to a given method and regular expression.
- public void path (Method method, string path, owned HandlerCallback handler, string? name = null)
Bind a callback to a given method and path.
- public void matcher (Method method, owned MatcherCallback matcher, owned HandlerCallback cb)
Bind a callback to a given method and a matcher callback.
- public void route (Route route, string? name = null)
Append a Route
object on the routing sequence.
- 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 string url_for (string name, ...)
Reverse an URL for a named
Valum.Route using varidic arguments.
- public void scope (string fragment, owned LoaderCallback loader)
Add a fragment to the scope stack and nest a router in this new
environment.
- public override bool handle (Request req, Response res) throws Error
Perform the routing of a pair of request and response objects.
Fields:
Inherited Members:
All known members inherited from class VSGI.Handler
All known members inherited from class GLib.Object
- @new
- newv
- new_valist
- get_type
- get_class
- @ref
- unref
- ref_sink
- weak_ref
- weak_unref
- add_weak_pointer
- remove_weak_pointer
- @get
- @set
- get_property
- set_property
- get_data
- set_data
- set_data_full
- steal_data
- get_qdata
- set_qdata
- set_qdata_full
- steal_qdata
- freeze_notify
- thaw_notify
- dispose
- constructed
- notify_property
- connect
- disconnect
- add_toggle_ref
- remove_toggle_ref
- bind_property
- notify
- ref_count