package yurt

  1. Overview
  2. Docs

Module Yurt.RouteSource

Routes are used to build URLs with types variables

Sourcetype route = [
  1. | `String of string
  2. | `Int of string
  3. | `Float of string
  4. | `Path of string
  5. | `Match of string * string
  6. | `Route of route list
]
Sourceexception Invalid_route_type

Invalid_route_type is raised when a value of the wrong type is requested

Sourcetype params = (string, route) Hashtbl.t

Param map

Sourceval to_string : route -> string

Convert a route to string

Sourceval to_regexp : route -> Str.regexp

Convert a route to regular expressions

Sourceval of_string : string -> route

Create a Route from the given string

Sourceval params : route -> string -> params

Get parameters from a route

Sourceval string : params -> string -> string

Get a string parameter

Sourceval int : params -> string -> int

Get an int parameter

Sourceval float : params -> string -> float

Get a float parameter

Sourceval to_json : params -> Ezjsonm.t

Convert parameters to JSON

OCaml

Innovation. Community. Security.