ligo/vendors/ocplib-resto
Grégoire Henry 5b50279851 Import new version of vendors/ocplib-resto
The new version of ocplib-resto :

- uses jbuilder ;
- is functorized over `Json_encoding` rather than `Json_repr` ;
- handles query parameters ;
- handles HTTP methods (GET, POST, DELETE, PUT, PATCH) ;
- replaces `custom_service` by a more generic trailer argument ;
- replaces generic answer `(code, body)` by a more ad-hoc sum type
  (allowing distinct encoding for success and error) ;
- includes a minimal HTTP-server based on Cohttp
  (includings CORS and media type negotiation).
- adds a function `Directory.transparent_lookup` to lookup/call
  a service handler without serializing the various parameters
  (path, query, request body).

As a first consequences in Tezos, this patch allows binary
communication between the client and the node.

This patch tries to be minimal inside the tezos source code and
therefore it introduces a minimal compatibility layer in
`RPC.ml`. This code should be removed as soon as possible.
2017-12-04 15:51:59 +01:00
..
lib_ezresto Import new version of vendors/ocplib-resto 2017-12-04 15:51:59 +01:00
lib_ezresto-directory Import new version of vendors/ocplib-resto 2017-12-04 15:51:59 +01:00
lib_resto Import new version of vendors/ocplib-resto 2017-12-04 15:51:59 +01:00
lib_resto-cohttp Import new version of vendors/ocplib-resto 2017-12-04 15:51:59 +01:00
lib_resto-directory Import new version of vendors/ocplib-resto 2017-12-04 15:51:59 +01:00
lib_resto-json Import new version of vendors/ocplib-resto 2017-12-04 15:51:59 +01:00
test Import new version of vendors/ocplib-resto 2017-12-04 15:51:59 +01:00
.gitignore Import new version of vendors/ocplib-resto 2017-12-04 15:51:59 +01:00
.ocp-indent Import new version of vendors/ocplib-resto 2017-12-04 15:51:59 +01:00
.travis.yml Import new version of vendors/ocplib-resto 2017-12-04 15:51:59 +01:00
CHANGES.md Import new version of vendors/ocplib-resto 2017-12-04 15:51:59 +01:00
jbuild Import new version of vendors/ocplib-resto 2017-12-04 15:51:59 +01:00
LICENSE Import new version of vendors/ocplib-resto 2017-12-04 15:51:59 +01:00
Makefile Import new version of vendors/ocplib-resto 2017-12-04 15:51:59 +01:00
ocplib-ezresto-directory.opam Import new version of vendors/ocplib-resto 2017-12-04 15:51:59 +01:00
ocplib-ezresto.opam Import new version of vendors/ocplib-resto 2017-12-04 15:51:59 +01:00
ocplib-resto-cohttp.opam Import new version of vendors/ocplib-resto 2017-12-04 15:51:59 +01:00
ocplib-resto-directory.opam Import new version of vendors/ocplib-resto 2017-12-04 15:51:59 +01:00
ocplib-resto-json.opam Import new version of vendors/ocplib-resto 2017-12-04 15:51:59 +01:00
ocplib-resto.opam Import new version of vendors/ocplib-resto 2017-12-04 15:51:59 +01:00
ocplib-resto.version Import new version of vendors/ocplib-resto 2017-12-04 15:51:59 +01:00
README.md Import new version of vendors/ocplib-resto 2017-12-04 15:51:59 +01:00

ocplib-resto (WIP)

This is a minimal OCaml library for type-safe HTTP/JSON RPCs.

This is based on a notion of service, à la Eliom, and it uses ocplib-json-typed for self-documenting JSON encoders.

See test_ezresto-directory/ezResto_test.ml or test_resto-directory/resto_test.ml for example.`