sig
type json = Server.Data.json
type kind = [ `EXEC | `GET | `SET ]
module type Input =
sig
type t
val syntax : Server.Syntax.t
val of_json : Server.Request.json -> Server.Request.Input.t
end
module type Output =
sig
type t
val syntax : Server.Syntax.t
val to_json : Server.Request.Output.t -> Server.Request.json
end
type 'a input = (module Server.Request.Input with type t = 'a)
type 'b output = (module Server.Request.Output with type t = 'b)
val register :
page:Server.Doc.page ->
kind:Server.Request.kind ->
name:string ->
descr:Markdown.text ->
?details:Markdown.block ->
input:'a Server.Request.input ->
output:'b Server.Request.output -> ('a -> 'b) -> unit
type ('a, 'b) signature
val signature :
page:Server.Doc.page ->
kind:Server.Request.kind ->
name:string ->
descr:Markdown.text ->
?details:Markdown.block ->
?input:'a Server.Request.input ->
?output:'b Server.Request.output ->
unit -> ('a, 'b) Server.Request.signature
type rq
type 'a param = Server.Request.rq -> 'a
type 'b result = Server.Request.rq -> 'b -> unit
val register_sig :
('a, 'b) Server.Request.signature ->
(Server.Request.rq -> 'a -> 'b) -> unit
val param :
(unit, 'b) Server.Request.signature ->
name:string ->
descr:Markdown.text ->
?default:'a -> 'a Server.Request.input -> 'a Server.Request.param
val param_opt :
(unit, 'b) Server.Request.signature ->
name:string ->
descr:Markdown.text ->
'a Server.Request.input -> 'a option Server.Request.param
val result :
('a, unit) Server.Request.signature ->
name:string ->
descr:Markdown.text ->
?default:'b -> 'b Server.Request.output -> 'b Server.Request.result
val result_opt :
('a, unit) Server.Request.signature ->
name:string ->
descr:Markdown.text ->
'b Server.Request.output -> 'b option Server.Request.result
end