Skip to content

Commit

Permalink
undo formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
anmonteiro committed Nov 5, 2019
1 parent 8a20512 commit f271b27
Showing 1 changed file with 29 additions and 59 deletions.
88 changes: 29 additions & 59 deletions lib/mirage_impl_http.ml
Original file line number Diff line number Diff line change
Expand Up @@ -5,76 +5,46 @@ type http = HTTP

let http = Type HTTP

let cohttp_server conduit =
impl
@@ object
inherit base_configurable

method ty = http

method name = "http"

method module_name = "Cohttp_mirage.Server_with_conduit"

method! packages =
Mirage_key.pure [package ~min:"2.1.0" ~max:"3.0.0" "cohttp-mirage"]

method! deps = [abstract conduit]

method! connect _i modname =
function
| [conduit] ->
Fmt.strf "%s.connect %s" modname conduit
| _ ->
failwith (connect_err "http" 1)
end

let httpaf_server conduit =
impl
@@ object
inherit base_configurable

method ty = http

method name = "httpaf"

method module_name = "Httpaf_mirage.Server_with_conduit"

method! packages = Mirage_key.pure [package "httpaf-mirage"]

method! deps = [abstract conduit]

method! connect _i modname =
function
| [conduit] ->
Fmt.strf "%s.connect %s" modname conduit
| _ ->
failwith (connect_err "httpaf" 1)
end

type http2 = HTTP2

let http2 = Type HTTP2

let cohttp_server conduit = impl @@ object
inherit base_configurable
method ty = http
method name = "http"
method module_name = "Cohttp_mirage.Server_with_conduit"
method! packages =
Mirage_key.pure [ package ~min:"2.1.0" ~max:"3.0.0" "cohttp-mirage" ]
method! deps = [ abstract conduit ]
method! connect _i modname = function
| [ conduit ] -> Fmt.strf "%s.connect %s" modname conduit
| _ -> failwith (connect_err "http" 1)
end

let httpaf_server conduit = impl @@ object
inherit base_configurable
method ty = http
method name = "httpaf"
method module_name = "Httpaf_mirage.Server_with_conduit"
method! packages =
Mirage_key.pure [ package "httpaf-mirage" ]
method! deps = [ abstract conduit ]
method! connect _i modname = function
| [ conduit ] -> Fmt.strf "%s.connect %s" modname conduit
| _ -> failwith (connect_err "httpaf" 1)
end

let http2_server conduit =
impl
@@ object
inherit base_configurable

method ty = http2

method name = "h2"

method module_name = "H2_mirage.Server_with_conduit"

method! packages = Mirage_key.pure [package "h2-mirage"]

method! deps = [abstract conduit]

method! connect _i modname =
function
| [conduit] ->
Fmt.strf "%s.connect %s" modname conduit
| _ ->
failwith (connect_err "h2" 1)
method! connect _i modname = function
| [conduit] -> Fmt.strf "%s.connect %s" modname conduit
| _ -> failwith (connect_err "h2" 1)
end

0 comments on commit f271b27

Please sign in to comment.