module Strelka.Core.Model where
import Strelka.Core.Prelude
data Request =
Request !Method ![PathSegment] !Query !(HashMap HeaderName HeaderValue) !InputStream
data Response =
Response !Status ![Header] !OutputStream
newtype Method =
Method ByteString
deriving (IsString, Show, Eq, Ord, Hashable)
newtype PathSegment =
PathSegment Text
deriving (IsString, Show, Eq, Ord, Hashable)
newtype Query =
Query ByteString
deriving (IsString, Show, Eq, Ord, Hashable)
data Header =
Header !HeaderName !HeaderValue
newtype HeaderName =
HeaderName ByteString
deriving (IsString, Show, Eq, Ord, Hashable)
newtype HeaderValue =
HeaderValue ByteString
deriving (IsString, Show, Eq, Ord, Hashable)
newtype Status =
Status Int
newtype InputStream =
InputStream (IO ByteString)
newtype OutputStream =
OutputStream ((ByteString -> IO ()) -> IO () -> IO ())