|
| 1 | +opam-version: "2.0" |
| 2 | +maintainer: "Anil Madhavapeddy < [email protected]>" |
| 3 | +authors: ["Anil Madhavapeddy" "Mindy Preston" "Thomas Gazagnaire"] |
| 4 | +license: "ISC" |
| 5 | +tags: "org:mirage" |
| 6 | +homepage: "https://github.com/mirage/mirage-channel" |
| 7 | +doc: "https://mirage.github.io/mirage-channel/" |
| 8 | +bug-reports: "https://github.com/mirage/mirage-channel/issues" |
| 9 | +depends: [ |
| 10 | + "ocaml" {>= "4.07.0"} |
| 11 | + "dune" {>= "1.0"} |
| 12 | + "mirage-flow" {>= "4.0.0"} |
| 13 | + "lwt" {>= "4.0.0"} |
| 14 | + "cstruct" {>= "6.0.0"} |
| 15 | + "logs" |
| 16 | + "fmt" {>= "0.8.7"} |
| 17 | + "alcotest" {with-test} |
| 18 | + "mirage-flow-combinators" {with-test & >= "2.0.0"} |
| 19 | +] |
| 20 | +conflicts: [ |
| 21 | + "tcpip" {< "3.0.0"} |
| 22 | +] |
| 23 | +build: [ |
| 24 | + ["dune" "subst"] {dev} |
| 25 | + ["dune" "build" "-p" name "-j" jobs] |
| 26 | + ["dune" "runtest" "-p" name "-j" jobs] {with-test} |
| 27 | +] |
| 28 | +dev-repo: "git+https://github.com/mirage/mirage-channel.git" |
| 29 | +synopsis: "Buffered channels for MirageOS FLOW types" |
| 30 | +description: """ |
| 31 | +Channels are buffered reader/writers built on top of unbuffered `FLOW` |
| 32 | +implementations. |
| 33 | + |
| 34 | +Example: |
| 35 | + |
| 36 | +```ocaml |
| 37 | +module Channel = Channel.Make(Flow) |
| 38 | +... |
| 39 | +Channel.read_exactly ~len:16 t |
| 40 | +>>= fun bufs -> (* read header of message *) |
| 41 | +let payload_length = Cstruct.(LE.get_uint16 (concat bufs) 0) in |
| 42 | +Channel.read_exactly ~len:payload_length t |
| 43 | +>>= fun bufs -> (* payload of message *) |
| 44 | + |
| 45 | +(* process message *) |
| 46 | + |
| 47 | +Channel.write_buffer t header; |
| 48 | +Channel.write_buffer t payload; |
| 49 | +Channel.flush t |
| 50 | +>>= fun () -> |
| 51 | +``` |
| 52 | + |
| 53 | +mirage-channel is distributed under the ISC license. |
| 54 | +""" |
| 55 | +x-maintenance-intent: [ "(latest)" ] |
| 56 | +url { |
| 57 | + src: |
| 58 | + "https://github.com/mirage/mirage-channel/releases/download/v5.0.0/mirage-channel-5.0.0.tbz" |
| 59 | + checksum: [ |
| 60 | + "sha256=2863bf7c8944f8d08052751e32572701bac2c5a4aa35569af61f0a3b83f25389" |
| 61 | + "sha512=cd4569d7d4d08de3b2565c72eeba2c0e1910664c79f971044d4f94c126aa2aeaac89925fb7f48b321a12517879c21eb998ad3d2551831f838cd64268f50e3877" |
| 62 | + ] |
| 63 | +} |
| 64 | +x-commit-hash: "de97e5210a1d0d905d5e29f34392d68ede38109e" |
0 commit comments