implemented GemRequest type and constructor
This commit is contained in:
parent
75d5e44278
commit
d1f26115f6
|
@ -25,11 +25,16 @@ License along with this program. If not, see
|
||||||
-}
|
-}
|
||||||
|
|
||||||
module Network.GemServ.Types (
|
module Network.GemServ.Types (
|
||||||
|
-- * Types
|
||||||
GemURL (..),
|
GemURL (..),
|
||||||
newGemURL
|
GemRequest (..),
|
||||||
|
-- * Constructors
|
||||||
|
newGemURL,
|
||||||
|
newGemRequest
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Data.Word (Word32)
|
import Data.Word (Word32)
|
||||||
|
import Data.X509 (Certificate)
|
||||||
|
|
||||||
-- | Gemini URL
|
-- | Gemini URL
|
||||||
data GemURL = GemURL
|
data GemURL = GemURL
|
||||||
|
@ -43,6 +48,14 @@ data GemURL = GemURL
|
||||||
-- ^ The decoded request query (if supplied)
|
-- ^ The decoded request query (if supplied)
|
||||||
} deriving (Eq, Show)
|
} deriving (Eq, Show)
|
||||||
|
|
||||||
|
-- | Describes a Gemini request
|
||||||
|
data GemRequest = GemRequest
|
||||||
|
{ reqURL :: GemURL
|
||||||
|
-- ^ The URL being requested
|
||||||
|
, reqCert :: Maybe Certificate
|
||||||
|
-- ^ The client certificate (if available)
|
||||||
|
} deriving (Eq, Show)
|
||||||
|
|
||||||
-- | Builds a new 'GemURL'
|
-- | Builds a new 'GemURL'
|
||||||
newGemURL
|
newGemURL
|
||||||
:: String
|
:: String
|
||||||
|
@ -55,4 +68,14 @@ newGemURL host = GemURL
|
||||||
, gemQuery = Nothing
|
, gemQuery = Nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- | Builds a 'GemRequest'
|
||||||
|
newGemRequest
|
||||||
|
:: GemURL
|
||||||
|
-- ^ The request URL
|
||||||
|
-> GemRequest
|
||||||
|
newGemRequest url = GemRequest
|
||||||
|
{ reqURL = url
|
||||||
|
, reqCert = Nothing
|
||||||
|
}
|
||||||
|
|
||||||
--jl
|
--jl
|
||||||
|
|
Loading…
Reference in New Issue
Block a user