package ez_api
Easy API library and tools
Install
Dune Dependency
github.com
Readme
LGPL-2.1-only WITH OCaml-LGPL-linking-exception License
Edit opam file
Versions (6)
Authors
Maintainers
Sources
v1.0.0.tar.gz
md5=d4dcb8a0be9cf87fca6471cecf083d9a
sha512=452a5de00bf0b51926d9c4c5c9062981c372ebce9ccfd0586b1e1b9b42c96721035dc7cd405e4bdd936ae0a7e69f442e4063713756b7cdac246319198fb89e2c
doc/ez_api.server_utils/EzAPIServerUtils/Directory/index.html
Module EzAPIServerUtils.Directory
Source
Source
type conflict =
| CService
| CDir
| CBuilder
| CCustom
| CTypes of EzAPI.Arg.descr * EzAPI.Arg.descr
| CType of EzAPI.Arg.descr * string list
Source
and 'a directory = {
services : 'a registered_service MethMap.t;
subdirs : 'a subdirectories option;
}
Source
and _ subdirectories =
| Suffixes : 'a directory StringMap.t -> 'a subdirectories
| Arg : 'a1 EzAPI.Arg.t * ('a * 'a1) directory -> 'a subdirectories
Source
and _ registered_service =
| Http : {
service : ('a, 'i, 'o, 'e, 's) EzAPI.Service.t;
handler : 'a -> 'i -> ('o, 'e) result Answer.t Lwt.t;
} -> 'a registered_service
| Websocket : {
service : ('a, 'i, 'o, 'e, 's) EzAPI.Service.t;
react : 'a -> 'i -> ('o, 'e) result Lwt.t;
bg : 'a -> (('o, 'e) result -> unit) -> unit Lwt.t;
onclose : ('a -> unit Lwt.t) option;
step : float option;
} -> 'a registered_service
Source
type lookup_error = [
| `Not_found
| `Cannot_parse of EzAPI.Arg.descr * string * string list
| `Method_not_allowed
]
Source
type handler_error = [
| EzEncoding.destruct_error
| `unsupported of string option
| `handler_exn of exn
| `handler_error of string
]
Source
type lookup_ok = [
| `head
| `options of (string * string) list
| `http of string -> (string Answer.t, handler_error) result Lwt.t
| `ws of (string -> (ws_frame, handler_error) result Lwt.t) * (((ws_frame, handler_error) result -> unit) -> unit Lwt.t) * (unit -> unit Lwt.t) option * float option
]
Source
val resolve :
'a. string list ->
'a directory ->
'a ->
string list ->
(resolved_directory, lookup_error) result Lwt.t
Source
val ser_websocket :
('a -> 'b -> ('c, 'd) result Lwt.t) ->
('a -> (('c, 'd) result -> 'e) -> 'f) ->
'a ->
'b EzAPI.IO.io ->
'c EzAPI.io ->
'd Json_encoding.encoding ->
(string ->
(ws_frame,
[> `cannot_destruct of string * string
| `handler_error of string
| `handler_exn of exn
| `unexpected_field of string ])
Result.result
Lwt.t)
* (((ws_frame, [> `handler_error of string ]) result -> 'e) ->
'f)
Source
val lookup :
?meth:[< `DELETE | `GET | `HEAD | `OPTIONS | `PATCH | `POST | `PUT ] ->
?content_type:string ->
'a directory ->
'a ->
string list ->
(lookup_ok, lookup_error) result Lwt.t
Source
val register :
'a. t ->
('a, 'b, 'c, 'd, [< EzAPI.Security.scheme ] as 'e) EzAPI.Service.t ->
(('a, 'b, 'c, 'd, 'e) EzAPI.Service.t -> 'a registered_service) ->
(t, Step.t list * conflict) result
Source
val register_http :
t ->
('a, 'b, 'c, 'd, [< EzAPI.Security.scheme ]) EzAPI.Service.t ->
('a -> 'b -> ('c, 'd) result Answer.t Lwt.t) ->
(t, Step.t list * conflict) result
Source
val register_ws :
t ->
?onclose:('a -> unit Lwt.t) ->
?step:float ->
react:('a -> 'b -> ('c, 'd) result Lwt.t) ->
bg:('a -> (('c, 'd) result -> unit) -> unit Lwt.t) ->
('a, 'b, 'c, 'd, [< EzAPI.Security.scheme ]) EzAPI.Service.t ->
(t, Step.t list * conflict) result
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>