name changes

changed names of certain functions and types to use the term "capsule" instead of "server"
This commit is contained in:
2021-11-17 15:32:39 -05:00
parent f751ccf191
commit 722864c842
2 changed files with 30 additions and 30 deletions
+19 -19
View File
@@ -30,12 +30,12 @@ module Network.Gemini.Capsule.Types (
GemRequest (..),
GemResponse (..),
GemHandler,
GemServSettings (..),
GemCapSettings (..),
-- * Constructors
newGemURL,
newGemRequest,
newGemResponse,
newGemServSettings
newGemCapSettings
) where
import qualified Data.ByteString.Lazy as BSL
@@ -75,17 +75,17 @@ data GemResponse = GemResponse
-- | Handles a 'GemRequest' to produce a 'GemResponse'
type GemHandler = GemRequest -> IO GemResponse
-- | The settings required to set up a Gemini server
data GemServSettings = GemServSettings
{ servConnections :: Int
-- | The settings required to set up a Gemini capsule
data GemCapSettings = GemCapSettings
{ capConnections :: Int
-- ^ Number of simultaneous connections allowed
, servPort :: Word16
-- ^ The server port number
, servCert :: FilePath
-- ^ The path to the server certificate
, servCertChain :: [FilePath]
, capPort :: Word16
-- ^ The capsule port number
, capCert :: FilePath
-- ^ The path to the TLS certificate
, capCertChain :: [FilePath]
-- ^ The paths to the chain certificates
, servKey :: FilePath
, capKey :: FilePath
-- ^ The path to the private key
} deriving (Eq, Show)
@@ -120,18 +120,18 @@ newGemResponse = GemResponse
}
-- | Builds a reasonable set of server settings.
newGemServSettings
newGemCapSettings
:: FilePath
-- ^ Path to the server certificate
-> FilePath
-- ^ Path to the private key
-> GemServSettings
newGemServSettings cert key = GemServSettings
{ servConnections = 100
, servPort = 1965
, servCert = cert
, servCertChain = []
, servKey = key
-> GemCapSettings
newGemCapSettings cert key = GemCapSettings
{ capConnections = 100
, capPort = 1965
, capCert = cert
, capCertChain = []
, capKey = key
}
--jl