package clz
All checked builds passInstall
dune-project
Dependency
Authors
Maintainers
Sources
sha256=98e87ae5b0283d866e5a888db59b5d63311c0c683faa0d3bea181cf28ac3c622
sha512=0fcf11ca574c387102ea642dd124236823eb3f751f93637059ee6ceddb431dda05177d78a467d78b8e7a9210797d97b34322fd941cd7a677d1ac65d1da5068a2
Description
The library interface tries to stay somewhat close to dream-encoding.
Usage example:
let get_with_compression_support ?headers uri =
let headers = Clz_cohttp.update_headers headers in
let open Lwt.Syntax in
let* resp, body = Cohttp_lwt_unix.Client.get ~headers uri in
let status = Cohttp_lwt.Response.status resp in
let* () = if status <> `OK then Cohttp_lwt.Body.drain_body body else Lwt.return_unit in
match status with
| `OK ->
let body = Clz_cohttp.decompress (resp, body) in
Lwt.return body
| _ -> Lwt.fail_with "Not Ok"
Added to opam-repository:
README
Compression support for cohttp-lwt using decompress
The library interface tries to stay somewhat close to dream-encoding.
Usage example:
let get_with_compression_support ?headers uri =
let headers = Clz_cohttp.update_headers headers in
let open Lwt.Syntax in
let* resp, body = Cohttp_lwt_unix.Client.get ~headers uri in
let status = Cohttp_lwt.Response.status resp in
let* () = if status <> `OK then Cohttp_lwt.Body.drain_body body else Lwt.return_unit in
match status with
| `OK ->
let body = Clz_cohttp.decompress (resp, body) in
Lwt.return body
| _ -> Lwt.fail_with "Not Ok"It provides three libraries:
clz: functions to inflate and deflate strings, in case one does not needcohttpclz.cfg: configuration for gzip deflate, separate only because it linksunixclz.cohttp: provides the module {!Clz_cohttp}, which contains helpers to add the necessary accept headers and to decompress the response bodies.
The documentation can be found on www.mseri.me/ocaml-clz/.
Why CLZ
The name was supposed to be temporary. Started as CUZ: Cohttp U gZip, but it really only supports cohttp-lwt, so it changed into CLS: Cohttp-Lwt-Zip, even if it supports both gzip and deflate. I use it in a lot of scripts now, more invasive changes would be way too time-consuming :P
Dependencies (7)
-
ptime
>= "0.8.0" -
decompress
>= "1.4.0" -
lwt
>= "5.3.0" -
cohttp-lwt
>= "2.5.0" -
bigstringaf
>= "0.2.0" -
ocaml
>= "4.08" -
dune
>= "2.0"
Dev Dependencies
None
Optional Dependencies
None
Used by (1)
Conflicts (1)
-
result
< "1.5"
Build status
Results of building clz with each compiler on check.ci.ocaml.org, run of against opam-repository 8a77e58. All results for this package.
Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.
| Version | OCaml 4.11 | OCaml 4.14 | OCaml 5.2 | OCaml 5.4 | OCaml 5.5 |
|---|---|---|---|---|---|
| 0.1.0 (this version) | good | good | good | good | good |
- good Package successfully built
- partial One of the dependencies failed to build
- bad Package failed to build
- n/a Package is not available in this environment
- internal Internal failure