package ocplib-resto

  1. Overview
  2. Docs

Parameters

Signature

include sig ... end
val construct : 't Json_encoding.encoding -> 't -> Repr.value
val destruct : 't Json_encoding.encoding -> Repr.value -> 't
val custom : ('t -> Repr.value) -> (Repr.value -> 't) -> schema:Json_schema.schema -> 't Json_encoding.encoding
type 'key directory =
  1. | Map : ('key -> 'inner_key) * 'inner_key directory -> 'key directory
  2. | Static : 'key static_directory -> 'key directory
  3. | Dynamic : string option * ('key -> 'key directory Lwt.t) -> 'key directory
  4. | Custom : string option * ('key -> string list -> custom_lookup Lwt.t) -> 'key directory
and 'key static_directory = {
  1. service : 'key registred_service option;
  2. subdirs : 'key static_subdirectories option;
}
and _ static_subdirectories =
  1. | Suffixes : 'key directory StringMap.t -> 'key static_subdirectories
  2. | Arg : 'a Resto_impl.Arg.arg * ('key * 'a) directory -> 'key static_subdirectories
and _ registred_service =
  1. | RegistredService : string option * 'i Json_encoding.encoding * 'o Json_encoding.encoding * ('key -> 'i -> 'o Answer.answer Lwt.t) -> 'key registred_service
val empty : 'a directory
val map_directory : 'a 'b. ('a -> 'b) -> 'b directory -> 'a directory
val map_static_directory : 'a 'b. ('a -> 'b) -> 'b static_directory -> 'a static_directory
val map_static_subdirectories : 'a 'b. ('a -> 'b) -> 'b static_subdirectories -> 'a static_subdirectories
val map_registred_service : 'a 'b. ('a -> 'b) -> 'b registred_service -> 'a registred_service
val map : ('a -> 'b) -> 'b directory -> 'a directory
val prefix : 'p 'pr. ('pr, 'p) Resto_impl.Path.path -> 'p directory -> 'pr directory
val merge_static_directory : 'p. step list -> 'p static_directory -> 'p static_directory -> 'p static_directory
val merge : 'a directory -> 'a directory -> 'a directory
val describe_static_directory : 'a. bool -> 'a static_directory -> Resto_impl.Description.static_directory_descr
val describe_static_subdirectories : 'a. 'a static_subdirectories -> Resto_impl.Description.static_subdirectories_descr
val pp_print_directory : Format.formatter -> 'a directory -> unit
type resolved_directory =
  1. | Dir : 'a directory * 'a -> resolved_directory
val resolve : 'a. string list -> 'a directory -> 'a -> string list -> resolved_directory Lwt.t
val lookup : 'a. 'a directory -> 'a -> string list -> (Repr.value -> Repr.value Answer.answer Lwt.t) Lwt.t
val describe_directory : 'a. ?recurse:bool -> 'a directory -> 'a -> string list -> Resto_impl.Description.directory_descr Lwt.t
val step_of_path : ('a, 'b) Resto_impl.Path.rpath -> step list
val conflict : ('a, 'b) Resto_impl.Path.rpath -> conflict -> 'c
val insert : 'k 'rk. ('rk, 'k) Resto_impl.Path.rpath -> 'rk directory -> 'k directory * ('k directory -> 'rk directory)
val register : 'p 'i 'o 'pr. 'pr directory -> ('pr, 'p, 'i, 'o) Resto_impl.service -> ('p -> 'i -> 'o Answer.answer Lwt.t) -> 'pr directory
val register_dynamic_directory : 'pr 'a. ?descr:string -> 'pr directory -> ('pr, 'a) Resto_impl.Path.path -> ('a -> 'a directory Lwt.t) -> 'pr directory
val register_custom_lookup : 'pr 'a. ?descr:string -> 'pr directory -> ('pr, 'a) Resto_impl.Path.path -> ('a -> string list -> custom_lookup Lwt.t) -> 'pr directory
val register_describe_directory_service : 'pr. 'pr directory -> ('pr, 'pr, bool option, Resto_impl.Description.directory_descr) Resto_impl.service -> 'pr directory
val register0 : 'a directory -> ('a, unit, 'b, 'c) Resto_impl.service -> ('b -> 'c Answer.answer Lwt.t) -> 'a directory
val register1 : 'a directory -> ('a, unit * 'b, 'c, 'd) Resto_impl.service -> ('b -> 'c -> 'd Answer.answer Lwt.t) -> 'a directory
val register2 : 'a directory -> ('a, (unit * 'b) * 'c, 'd, 'e) Resto_impl.service -> ('b -> 'c -> 'd -> 'e Answer.answer Lwt.t) -> 'a directory
val register3 : 'a directory -> ('a, ((unit * 'b) * 'c) * 'd, 'e, 'f) Resto_impl.service -> ('b -> 'c -> 'd -> 'e -> 'f Answer.answer Lwt.t) -> 'a directory
val register4 : 'a directory -> ('a, (((unit * 'b) * 'c) * 'd) * 'e, 'f, 'g) Resto_impl.service -> ('b -> 'c -> 'd -> 'e -> 'f -> 'g Answer.answer Lwt.t) -> 'a directory
val register5 : 'a directory -> ('a, ((((unit * 'b) * 'c) * 'd) * 'e) * 'f, 'g, 'h) Resto_impl.service -> ('b -> 'c -> 'd -> 'e -> 'f -> 'g -> 'h Answer.answer Lwt.t) -> 'a directory
val register_dynamic_directory0 : ?descr:string -> 'a directory -> ('a, unit) Resto_impl.Path.path -> unit directory Lwt.t -> 'a directory
val register_dynamic_directory1 : ?descr:string -> 'a directory -> ('a, unit * 'b) Resto_impl.Path.path -> ('b -> (unit * 'b) directory Lwt.t) -> 'a directory
val register_dynamic_directory2 : ?descr:string -> 'a directory -> ('a, (unit * 'b) * 'c) Resto_impl.Path.path -> ('b -> 'c -> ((unit * 'b) * 'c) directory Lwt.t) -> 'a directory
val register_dynamic_directory3 : ?descr:string -> 'a directory -> ('a, ((unit * 'b) * 'c) * 'd) Resto_impl.Path.path -> ('b -> 'c -> 'd -> (((unit * 'b) * 'c) * 'd) directory Lwt.t) -> 'a directory
val register_custom_lookup1 : ?descr:string -> 'a directory -> ('a, unit * 'b) Resto_impl.Path.path -> ('b -> string list -> custom_lookup Lwt.t) -> 'a directory
val register_custom_lookup2 : ?descr:string -> 'a directory -> ('a, (unit * 'b) * 'c) Resto_impl.Path.path -> ('b -> 'c -> string list -> custom_lookup Lwt.t) -> 'a directory
val register_custom_lookup3 : ?descr:string -> 'a directory -> ('a, ((unit * 'b) * 'c) * 'd) Resto_impl.Path.path -> ('b -> 'c -> 'd -> string list -> custom_lookup Lwt.t) -> 'a directory