0 | ||| Define core types and functions
 1 | module Pact.WAI.Core
 2 |
 3 | import Derive.Prelude
 4 | import public Data.SortedMap
 5 |
 6 | import FS.Posix
 7 | import FS.Socket
 8 |
 9 | import IO.Async.Loop.Epoll
10 |
11 | import public Data.ByteVect
12 | import public System.Posix.Errno.Type
13 | import public IO.Async.Loop.Posix
14 | import Pact.WAI.HTTPErr
15 |
16 | %default total
17 | %default covering
18 |
19 | %language ElabReflection
20 |
21 | ||| HTTP pull stream type
22 | ||| Represents an asynchronous stream from which HTTP data can be pulled
23 | ||| @ o Output type
24 | ||| @ r Result type
25 | public export
26 | 0 HTTPPull : Type -> Type -> Type
27 | HTTPPull o r = AsyncPull Poll o [Errno,HTTPErr] r
28 |
29 | ||| HTTP byte stream type
30 | ||| Represents an HTTP stream from which bytes can be pulled
31 | ||| @ o Output type
32 | public export
33 | 0 HTTPStream : Type -> Type
34 | HTTPStream o = AsyncPull Poll o [Errno,HTTPErr] ()
35 |
36 |
37 | ||| HTTP Query parameter type
38 | ||| Represented as a key-value map, both key and value are strings
39 | public export
40 | 0 QueryParams : Type
41 | QueryParams = SortedMap String String