]> git.immae.eu Git - github/fretlink/haskell-graylog.git/blobdiff - src/Graylog/Types.hs
Added readme, license, and light commenting.
[github/fretlink/haskell-graylog.git] / src / Graylog / Types.hs
index 5c32a8b52d74a5ebe7a8255ea66607f4a126a5d0..5ec779bb1e46db9d4d5be0d8ea5e64e932ca9696 100644 (file)
@@ -22,8 +22,11 @@ import qualified Data.Text      as T
 import           Network.BSD
 import           Network.Socket
 
+-- | The maximum size of each datagram when using UDP transit methods.
 type ChunkSize = Word
 
+-- | Handle for a socket connected to Graylog. In some cases this socket
+-- is UDP and will not have a maintained session.
 data Graylog
    = Graylog
       { _graylogHost      :: String
@@ -38,7 +41,10 @@ defaultChunkSize :: ChunkSize
 defaultChunkSize = 8192
 
 openGraylog
-   :: HostName -> ServiceName -> ChunkSize -> IO (Either String Graylog)
+   :: HostName          -- ^ The host on which graylog is running.
+   -> ServiceName       -- ^ The port on which graylog is running.
+   -> ChunkSize         -- ^ The maximum size of each UDP datagram.
+   -> IO (Either String Graylog)
 openGraylog h p cksize
    | cksize < 1024 = return $ Left "ChunkSize must be at least 1024."
    | otherwise     = getAddrInfo Nothing (Just h) (Just p) >>= \case