package ocplib-resto

  1. Overview
  2. Docs
module Answer : sig ... end
type step =
  1. | Static of string
  2. | Dynamic of Resto.Arg.descr

Possible error while registring services.

type conflict =
  1. | CService
  2. | CDir
  3. | CBuilder
  4. | CCustom
  5. | CTypes of Resto.Arg.descr * Resto.Arg.descr
  6. | CType of Resto.Arg.descr * string list
exception Conflict of step list * conflict
exception Cannot_parse of Resto.Arg.descr * string * string list
module Make (Repr : Json_repr.Repr) : sig ... end
include sig ... end
type 'prefix directory = 'prefix Make(Json_repr.Ezjsonm).directory

Dispatch tree

val empty : 'prefix directory

Empty tree

val map : ('a -> 'b) -> 'b directory -> 'a directory
val prefix : ('pr, 'p) Resto.Path.path -> 'p directory -> 'pr directory
val merge : 'a directory -> 'a directory -> 'a directory
val lookup : 'prefix directory -> 'prefix -> string list -> (Json_repr.Ezjsonm.value -> Json_repr.Ezjsonm.value Answer.answer Lwt.t) Lwt.t

Resolve a service.

val register : 'prefix directory -> ('prefix, 'params, 'input, 'output) Resto.service -> ('params -> 'input -> 'output Answer.answer Lwt.t) -> 'prefix directory

Registring handler in service tree.

val register0 : unit directory -> (unit, unit, 'i, 'o) Resto.service -> ('i -> 'o Answer.answer Lwt.t) -> unit directory

Registring handler in service tree. Curryfied variant.

val register1 : 'prefix directory -> ('prefix, unit * 'a, 'i, 'o) Resto.service -> ('a -> 'i -> 'o Answer.answer Lwt.t) -> 'prefix directory
val register2 : 'prefix directory -> ('prefix, (unit * 'a) * 'b, 'i, 'o) Resto.service -> ('a -> 'b -> 'i -> 'o Answer.answer Lwt.t) -> 'prefix directory
val register3 : 'prefix directory -> ('prefix, ((unit * 'a) * 'b) * 'c, 'i, 'o) Resto.service -> ('a -> 'b -> 'c -> 'i -> 'o Answer.answer Lwt.t) -> 'prefix directory
val register4 : 'prefix directory -> ('prefix, (((unit * 'a) * 'b) * 'c) * 'd, 'i, 'o) Resto.service -> ('a -> 'b -> 'c -> 'd -> 'i -> 'o Answer.answer Lwt.t) -> 'prefix directory
val register5 : 'prefix directory -> ('prefix, ((((unit * 'a) * 'b) * 'c) * 'd) * 'e, 'i, 'o) Resto.service -> ('a -> 'b -> 'c -> 'd -> 'e -> 'i -> 'o Answer.answer Lwt.t) -> 'prefix directory
val register_dynamic_directory : ?descr:string -> 'prefix directory -> ('prefix, 'a) Resto.Path.path -> ('a -> 'a directory Lwt.t) -> 'prefix directory

Registring dynamic subtree.

val register_dynamic_directory1 : ?descr:string -> 'prefix directory -> ('prefix, unit * 'a) Resto.Path.path -> ('a -> (unit * 'a) directory Lwt.t) -> 'prefix directory

Registring dynamic subtree. (Curryfied variant)

val register_dynamic_directory2 : ?descr:string -> 'prefix directory -> ('prefix, (unit * 'a) * 'b) Resto.Path.path -> ('a -> 'b -> ((unit * 'a) * 'b) directory Lwt.t) -> 'prefix directory
val register_dynamic_directory3 : ?descr:string -> 'prefix directory -> ('prefix, ((unit * 'a) * 'b) * 'c) Resto.Path.path -> ('a -> 'b -> 'c -> (((unit * 'a) * 'b) * 'c) directory Lwt.t) -> 'prefix directory
val register_custom_lookup : ?descr:string -> 'prefix directory -> ('prefix, 'params) Resto.Path.path -> ('params -> string list -> custom_lookup Lwt.t) -> 'prefix directory
val register_custom_lookup1 : ?descr:string -> 'prefix directory -> ('prefix, unit * 'a) Resto.Path.path -> ('a -> string list -> custom_lookup Lwt.t) -> 'prefix directory
val register_custom_lookup2 : ?descr:string -> 'prefix directory -> ('prefix, (unit * 'a) * 'b) Resto.Path.path -> ('a -> 'b -> string list -> custom_lookup Lwt.t) -> 'prefix directory
val register_custom_lookup3 : ?descr:string -> 'prefix directory -> ('prefix, ((unit * 'a) * 'b) * 'c) Resto.Path.path -> ('a -> 'b -> 'c -> string list -> custom_lookup Lwt.t) -> 'prefix directory
val register_describe_directory_service : 'prefix directory -> ('prefix, 'prefix, bool option, Resto.Description.directory_descr) Resto.service -> 'prefix directory

Registring a description service.

OCaml

Innovation. Community. Security.