PeerTubee - Eio-based PeerTube API Client#
This is a port of the PeerTube library from Lwt/Cohttp to Eio/Requests.
Changes from Original#
- Removed
open Lwt.Infix - Replaced all
Lwt.treturn types with direct return types (direct-style) - Added
~sw:Eio.Switch.tand~env:<...>parameters to all public functions - Replaced
Cohttp_lwt_unix.Client.getwithRequests.One.get - Replaced
Cohttp_lwt.Body.to_string body >>= fun s ->withlet s = Requests.Response.body response |> Eio.Flow.read_all in - Replaced
>>=(Lwt.bind) with direct let bindings - Replaced
Lwt.returnwith direct values - Replaced
Lwt.return_ok/Lwt.return_errorwithOk/Error - Replaced
open_out_binwithEio.Path.savefor file writing - Used
Requests.One.createwithEio.Stdenv.clockandEio.Stdenv.net
Statistics#
- Original: 191 lines
- Ported: 188 lines
- Functions: 8 public functions
- All JSON parsing logic preserved
- All type definitions preserved
Files Created#
/workspace/stack/bushel/peertubee/peertubee.ml- Implementation (188 lines)/workspace/stack/bushel/peertubee/peertubee.mli- Interface (69 lines)/workspace/stack/bushel/peertubee/dune- Build configuration/workspace/stack/bushel/peertubee.opam- Package metadata
Dependencies#
- ezjsonm - JSON parsing
- eio + eio.core - Effects-based concurrency
- requests - HTTP client
- ptime - Time handling
- fmt - Formatted output