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 ByteString -> a) -> IO (Either PinboardError a)
- runPinboardSingleRawBS :: PinboardConfig -> PinboardRequest -> IO (Either PinboardError ByteString)
- runPinboardSingleJson :: FromJSON a => PinboardConfig -> PinboardRequest -> IO (Either PinboardError a)
- sendPinboardRequest :: PinboardRequest -> PinboardConfig -> Manager -> (Response ByteString -> a) -> IO a
- mgrOpenRaw :: IO Manager
- mgrOpen :: IO (Either SomeException Manager)
- mgrFail :: PinboardErrorType -> SomeException -> IO (Either PinboardError b)
- parseJSONResponse :: FromJSON a => Response ByteString -> Either PinboardError a
- decodeJSONResponse :: FromJSON a => ByteString -> Either PinboardError a
- checkStatusCodeResponse :: Response a -> Either PinboardError ()
- checkStatusCode :: Int -> 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 ByteString -> 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 -> Manager -> (Response ByteString -> a) -> IO a Source
Manager (http-client)
mgrFail :: PinboardErrorType -> SomeException -> IO (Either PinboardError b) Source
JSON Handling
parseJSONResponse :: FromJSON a => Response ByteString -> Either PinboardError a Source
decodeJSONResponse :: FromJSON a => ByteString -> Either PinboardError a Source
Status Codes
checkStatusCodeResponse :: Response a -> Either PinboardError () Source
checkStatusCode :: Int -> Either PinboardError () Source
Error Helpers
addErrMsg :: Text -> PinboardError -> PinboardError Source
Client Dependencies
module Pinboard.Client.Error
module Pinboard.Client.Types
module Pinboard.Client.Util