Portability | portable |
---|---|
Stability | none |
Maintainer | uzytkownik2@gmail.com |
This module contains internalities of NNTP library
- newtype NntpT m a = NntpT {}
- data NntpState m = NntpState {
- connection :: NntpConnection m
- data NntpConnection m = NntpConnection {
- input :: ByteString
- output :: ByteString -> m ()
- data NntpError
- type NntpParser m a = ParsecT ByteString () (NntpT m) a
- runNntpParser :: Monad m => NntpParser m a -> NntpT m a
- nntpPutStr :: Monad m => ByteString -> NntpT m ()
- nntpPutStrLn :: Monad m => ByteString -> NntpT m ()
- nntpSendCommand :: Monad m => String -> ByteString -> [(Int, NntpParser m a)] -> NntpT m a
- nntpSendText :: Monad m => ByteString -> [(Int, NntpParser m a)] -> NntpT m a
- nntpPSendCommand :: Monad m => String -> ByteString -> [(Int, NntpParser m a)] -> NntpParser m a
- nntpPSendText :: Monad m => ByteString -> [(Int, NntpParser m a)] -> NntpParser m a
- tryCommands :: Monad m => [NntpT m a] -> NntpT m a
- postize :: ByteString -> ByteString
- depostize :: ByteString -> ByteString
Types
NntpT represents a connection. Since some servers have short timeouts it is recommended to keep the connections short.
NntpState represents a state at given moment. Please note that this type is not a part of stable API (when we will have one).
data NntpConnection m Source
NntpConnection represents a connection in a NntpT monad.
Please note that for runNntpWithConnection
you need to supply both input
and output
functions.
NntpConnection | |
|
Indicates an error of handling NNTP connection. Please note that this should
indicate client errors only (with the exception of ServiceDiscontinued
,
in some cases PostingFailed
and NoSuchCommand
. The last one if propagated
outside NNTP module indicates a bug in library or server.).
NoSuchGroup | Indicates that operation was performed on group that does not exists. |
NoSuchArticle | Indicates that operation was performed on article that does not exists. |
PostingFailed | Indicates that posting operation failed for some reason. |
PostingNotAllowed | Indicates that posting is not allowed. |
ServiceDiscontinued | Indicates that service was discontinued. |
NoSuchCommand | Indicates that command does not exists. |
type NntpParser m a = ParsecT ByteString () (NntpT m) aSource
Functions
runNntpParser :: Monad m => NntpParser m a -> NntpT m aSource
Transforms NntpParser into NntpT monad taking care about input position
nntpPutStr :: Monad m => ByteString -> NntpT m ()Source
Puts an argument to output.
nntpPutStrLn :: Monad m => ByteString -> NntpT m ()Source
Puts an argument to output followed by end-of-line.
:: Monad m | |
=> String | Command. |
-> ByteString | Arguments. |
-> [(Int, NntpParser m a)] | Parser of output. |
-> NntpT m a | Returned value from parser. |
Sends a command.
:: Monad m | |
=> ByteString | Text |
-> [(Int, NntpParser m a)] | Parser of output. |
-> NntpT m a | Returned value from parser. |
Sends text
:: Monad m | |
=> String | Command. |
-> ByteString | Arguments. |
-> [(Int, NntpParser m a)] | Parser of output. |
-> NntpParser m a | Returned value from parser. |
Sends a command.
:: Monad m | |
=> ByteString | Text |
-> [(Int, NntpParser m a)] | Parser of output. |
-> NntpParser m a | Returned value from parser. |
Sends text
Try commands one by one to check for existing command.
postize :: ByteString -> ByteStringSource
Converts into postable form.
depostize :: ByteString -> ByteStringSource
Converts from postable form