remove functors
This commit is contained in:
parent
13c591b58e
commit
b17532d2c7
6 changed files with 9 additions and 18 deletions
|
@ -11,19 +11,18 @@ depends: [
|
|||
"dune" {>= "2.3"}
|
||||
"ocaml" {>= "4.11.0"}
|
||||
"paf" {>= "0.2.0"}
|
||||
"mirage-clock" {>= "4.0.0"}
|
||||
"mirage-time" {>= "3.0.0"}
|
||||
"tcpip" {>= "7.0.0"}
|
||||
"lwt" {>= "5.5.0"}
|
||||
"mimic-happy-eyeballs" {>= "0.0.9"}
|
||||
"httpaf"
|
||||
"alcotest-lwt" {with-test & >= "1.0.0"}
|
||||
"mirage-clock-unix" {with-test & >= "4.0.0"}
|
||||
"mirage-crypto-rng" {with-test}
|
||||
"mirage-time-unix" {with-test & >= "3.0.0"}
|
||||
"dns-client-mirage" {with-test & >= "10.0.0"}
|
||||
"happy-eyeballs-mirage" {with-test & >= "2.0.0"}
|
||||
"h2" {>= "0.10.0"}
|
||||
"tls" {>= "1.0.0"}
|
||||
"x509" {>= "1.0.0"}
|
||||
"ca-certs-nss" {>= "3.108-1"}
|
||||
]
|
||||
build: [
|
||||
["dune" "subst"] {dev}
|
||||
|
|
2
src/dune
2
src/dune
|
@ -1,4 +1,4 @@
|
|||
(library
|
||||
(name http_mirage_client)
|
||||
(public_name http-mirage-client)
|
||||
(libraries paf mirage-clock x509 tcpip mimic-happy-eyeballs httpaf h2))
|
||||
(libraries paf x509 tcpip mimic-happy-eyeballs httpaf h2 ca-certs-nss))
|
||||
|
|
|
@ -22,7 +22,6 @@ module type S = sig
|
|||
end
|
||||
|
||||
module Make
|
||||
(Pclock : Mirage_clock.PCLOCK)
|
||||
(TCP : Tcpip.Tcp.S)
|
||||
(Happy_eyeballs : Mimic_happy_eyeballs.S with type flow = TCP.flow) : S =
|
||||
struct
|
||||
|
@ -86,9 +85,7 @@ struct
|
|||
| Error _ -> None)
|
||||
| _ -> None
|
||||
|
||||
let authenticator =
|
||||
let module V = Ca_certs_nss.Make (Pclock) in
|
||||
V.authenticator ()
|
||||
let authenticator = Ca_certs_nss.authenticator ()
|
||||
|
||||
let connect ctx =
|
||||
let k0 happy_eyeballs http_scheme http_hostname http_port =
|
||||
|
|
|
@ -7,7 +7,6 @@ module type S = sig
|
|||
end
|
||||
|
||||
module Make
|
||||
(Pclock : Mirage_clock.PCLOCK)
|
||||
(TCP : Tcpip.Tcp.S)
|
||||
(Happy_eyeballs : Mimic_happy_eyeballs.S with type flow = TCP.flow) : S
|
||||
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
(executable
|
||||
(name test)
|
||||
(libraries fmt.tty logs.fmt http-mirage-client tcpip.stack-socket paf.mirage
|
||||
mirage-clock-unix mirage-crypto-rng mirage-time-unix mimic-happy-eyeballs
|
||||
alcotest-lwt))
|
||||
mirage-crypto-rng mimic-happy-eyeballs alcotest-lwt))
|
||||
|
||||
(rule
|
||||
(alias runtest)
|
||||
|
|
|
@ -17,12 +17,10 @@ let () = Logs.set_level ~all:true (Some Logs.Debug)
|
|||
(* Functoria *)
|
||||
|
||||
module Happy_eyeballs =
|
||||
Happy_eyeballs_mirage.Make (Time) (Mclock) (Tcpip_stack_socket.V4V6)
|
||||
Happy_eyeballs_mirage.Make (Tcpip_stack_socket.V4V6)
|
||||
|
||||
module DNS_client =
|
||||
Dns_client_mirage.Make (Mirage_crypto_rng) (Time) (Mclock) (Pclock)
|
||||
(Tcpip_stack_socket.V4V6)
|
||||
(Happy_eyeballs)
|
||||
Dns_client_mirage.Make (Tcpip_stack_socket.V4V6) (Happy_eyeballs)
|
||||
|
||||
module Mimic_happy_eyeballs =
|
||||
Mimic_happy_eyeballs.Make (Tcpip_stack_socket.V4V6) (Happy_eyeballs)
|
||||
|
@ -31,8 +29,7 @@ module Mimic_happy_eyeballs =
|
|||
module HTTP_server = Paf_mirage.Make (Tcpip_stack_socket.V4V6.TCP)
|
||||
|
||||
module HTTP_client =
|
||||
Http_mirage_client.Make (Pclock) (Tcpip_stack_socket.V4V6.TCP)
|
||||
(Mimic_happy_eyeballs)
|
||||
Http_mirage_client.Make (Tcpip_stack_socket.V4V6.TCP) (Mimic_happy_eyeballs)
|
||||
|
||||
let http_1_1_error_handler ?notify (ipaddr, port) ?request:_ error respond =
|
||||
let contents =
|
||||
|
|
Loading…
Reference in a new issue