package miaou-core
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Miaou core/widgets (no drivers, no SDL)
Install
dune-project
Dependency
Authors
Maintainers
Sources
v0.5.2.tar.gz
md5=60a3b9f181f24572a06a9492532bfdda
sha512=fcc35a275066be2900e6201782faf47503076fa4640f08cf78067835a6f447b74613009e55b2ac799adb7ca46f1bffa261fc5971753f2cc3c6bef327511c7ef6
doc/miaou-core.lib/Miaou/Net/index.html
Module Miaou.NetSource
Network capability: minimal HTTP fetch helpers.
The core uses this capability for simple, synchronous HTTP GET-like operations. Each function receives the rpc_addr and app_bin_dir of the target service as passed-through context; implementations may use them to prefer local IPC (e.g., call a bundled client binary) or to construct requests. Calls are expected to run inside a shared Eio_main.run loop; the global fiber runtime must be initialized via Miaou_helpers.Fiber_runtime.init.
Conventions
- Both functions return
(Ok body) | Error msg. TheErrortext is intended for direct display to users when a fetch fails. http_get_stringis intended for small textual responses where the caller may further parse or decode the string.http_get_urlis the more general helper; callers should prefer it for fetching arbitrary URLs (the core uses it for RPC-style endpoints).
Example implementation (using curl/wget fallback):
let http_get_url ~rpc_addr:_ ~app_bin_dir:_ url =
match Common.run_out ["curl"; "-sfm"; "2"; "--connect-timeout"; "0.8"; url] with
| Ok s when s <> "" -> Ok s
| _ -> Error (Printf.sprintf "Failed to fetch %s" url)
let http_get_string = http_get_url
Miaou.Net.register (Miaou.Net.create ~http_get_string ~http_get_url)Source
val create :
http_get_string:
(env:Eio_unix.Stdenv.base ->
rpc_addr:string ->
app_bin_dir:string ->
string ->
(string, string) result) ->
http_get_url:
(env:Eio_unix.Stdenv.base ->
rpc_addr:string ->
app_bin_dir:string ->
string ->
(string, string) result) ->
t sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>