0 | module Node.HTTP2.Connect
 1 |
 2 | import Node
 3 |
 4 | public export
 5 | record Options where
 6 |   constructor MkOptions
 7 |   ca : String
 8 |   rejectUnauthorized : Bool
 9 |
10 | export
11 | defaultOptions : Options
12 | defaultOptions = MkOptions
13 |   { ca = ""
14 |   , rejectUnauthorized = True
15 |   }
16 |
17 | %foreign """
18 |   node:lambda:
19 |   (ca, rejectUnauthorized) => ({
20 |     ca: ca || undefined,
21 |     rejectUnauthorized: rejectUnauthorized != 0
22 |   })
23 |   """
24 | ffi_nodeConnectOptions : String -> Bool -> Node Options
25 |
26 | export
27 | convertOptions : Connect.Options -> Node Options
28 | convertOptions (MkOptions ca rejectUnauthorized)
29 |   = ffi_nodeConnectOptions ca rejectUnauthorized
30 |
31 |