package ocplib-resto
Minimal OCaml library for type-safe HTTP/JSON RPCs.
Install
Dune Dependency
Authors
Maintainers
Sources
ocplib-resto_0.1.tar.gz
sha256=bee2c7a395f2fc1518584d5feb13696d590a7eb4dbd39f40605dc368042e0271
md5=0433b7493bf8cd05fcb164e7482fa12e
doc/ocplib-resto.directory/RestoDirectory/index.html
Module RestoDirectory
module Answer : sig ... end
Possible error while registring services.
type conflict =
| CService
| CDir
| CBuilder
| CCustom
| CTypes of Resto.Arg.descr * Resto.Arg.descr
| CType of Resto.Arg.descr * string list
exception Cannot_parse of Resto.Arg.descr * string * string list
include sig ... end
val empty : 'prefix directory
Empty tree
val prefix : ('pr, 'p) Resto.Path.path -> 'p directory -> 'pr 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
type custom_lookup = Make(Json_repr.Ezjsonm).custom_lookup =
| CustomService of Resto.Description.service_descr * Json_repr.Ezjsonm.value -> Json_repr.Ezjsonm.value Answer.answer Lwt.t
| 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.
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>