-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
eio(client): 'run' to tak stack and crypto params
Make `run` accept crypto rng generator parameters. The 'f' function is injected with stack parameter. Address misc. reviewer comments.
- Loading branch information
Showing
4 changed files
with
76 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,24 @@ | ||
type env = < | ||
type 'a env = < | ||
clock : Eio.Time.clock ; | ||
net : Eio.Net.t ; | ||
fs : Eio.Dir.t ; | ||
fs : Eio.Fs.dir Eio.Path.t ; | ||
secure_random : Eio.Flow.source ; | ||
> | ||
.. | ||
> as 'a | ||
|
||
module Transport : Dns_client.S | ||
with type io_addr = Ipaddr.t * int | ||
and type stack = env * Eio.Switch.t | ||
and type +'a io = 'a | ||
|
||
module type DNS_CLIENT = module type of Dns_client.Make(Transport) | ||
|
||
val run : < env; ..> -> ((module DNS_CLIENT) -> 'a) -> 'a | ||
val run : | ||
?resolv_conf:string | ||
-> ?g: 'a | ||
-> 'a Mirage_crypto_rng.generator | ||
-> _ env | ||
-> (Transport.stack -> (module DNS_CLIENT) -> 'b) | ||
-> 'b | ||
(** [run crypto_rng_generator env f] starts the [crypto_rng_generator] required by [ocaml-dns]. | ||
It then creates [stack] and [Client] module and calls [f stack (module Client)]. module | ||
[Client] can be used to execute Dns client functions. *) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters