Copyright | (c) Jon Schoning, 2015 |
---|---|
Maintainer | jonschoning@gmail.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
- fromApiToken :: String -> PinboardConfig
- data PinboardConfig = PinboardConfig {
- apiToken :: ByteString
- debug :: Bool
- runPinboard :: PinboardConfig -> Pinboard a -> IO (Either PinboardError a)
- pinboardJson :: FromJSON a => PinboardRequest -> Pinboard a
- runPinboardSingleRaw :: PinboardConfig -> PinboardRequest -> (Response -> InputStream ByteString -> IO a) -> IO (Either PinboardError a)
- runPinboardSingleRawBS :: PinboardConfig -> PinboardRequest -> IO (Either PinboardError ByteString)
- runPinboardSingleJson :: FromJSON a => PinboardConfig -> PinboardRequest -> IO (Either PinboardError a)
- sendPinboardRequest :: PinboardRequest -> PinboardConfig -> Connection -> (Response -> InputStream ByteString -> IO a) -> IO a
- sendPinboardRequestBS :: PinboardRequest -> PinboardConfig -> Connection -> IO (Response, ByteString)
- connOpenRaw :: IO Connection
- connOpen :: IO (Either SomeException Connection)
- connClose :: Either a Connection -> IO ()
- connFail :: PinboardErrorType -> SomeException -> IO (Either PinboardError b)
- parseJSONResponseStream :: FromJSON a => Response -> InputStream ByteString -> IO (Response, Either PinboardError a)
- parseJSONFromStream :: FromJSON a => InputStream ByteString -> IO (Either PinboardError a)
- checkStatusCode :: StatusCode -> Either PinboardError ()
- addErrMsg :: Text -> PinboardError -> PinboardError
- createParserErr :: Text -> PinboardError
- httpStatusPinboardError :: PinboardErrorHTTPCode -> Either PinboardError a
- module Pinboard.Client.Error
- module Pinboard.Client.Types
- module Pinboard.Client.Util
Config
fromApiToken :: String -> PinboardConfig Source
Create a default PinboardConfig using the supplied apiToken
The PinboardConfig provides authentication via apiToken
Monadic
runPinboard :: PinboardConfig -> Pinboard a -> IO (Either PinboardError a) Source
Execute computations in the Pinboard monad
pinboardJson :: FromJSON a => PinboardRequest -> Pinboard a Source
Create a Pinboard value from a PinboardRequest w/ json deserialization
Single
runPinboardSingleRaw :: PinboardConfig -> PinboardRequest -> (Response -> InputStream ByteString -> IO a) -> IO (Either PinboardError a) Source
runPinboardSingleRawBS :: PinboardConfig -> PinboardRequest -> IO (Either PinboardError ByteString) Source
runPinboardSingleJson :: FromJSON a => PinboardConfig -> PinboardRequest -> IO (Either PinboardError a) Source
Sending
sendPinboardRequest :: PinboardRequest -> PinboardConfig -> Connection -> (Response -> InputStream ByteString -> IO a) -> IO a Source
sendPinboardRequestBS :: PinboardRequest -> PinboardConfig -> Connection -> IO (Response, ByteString) Source
Connections
connClose :: Either a Connection -> IO () Source
connFail :: PinboardErrorType -> SomeException -> IO (Either PinboardError b) Source
JSON Streams
parseJSONResponseStream :: FromJSON a => Response -> InputStream ByteString -> IO (Response, Either PinboardError a) Source
parseJSONFromStream :: FromJSON a => InputStream ByteString -> IO (Either PinboardError a) Source
Status Codes
checkStatusCode :: StatusCode -> Either PinboardError () Source
Error Helpers
addErrMsg :: Text -> PinboardError -> PinboardError Source
Client Dependencies
module Pinboard.Client.Error
module Pinboard.Client.Types
module Pinboard.Client.Util