package ocplib-resto

  1. Overview
  2. Docs

Parameters

Signature

type 'prefix 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 -> (Repr.value -> Repr.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
type custom_lookup =
  1. | CustomService of Resto.Description.service_descr * Repr.value -> Repr.value Answer.answer Lwt.t
  2. | CustomDirectory of Resto.Description.directory_descr

Registring custom directory lookup.

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.