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
- runPinboard :: MonadIO m => PinboardConfig -> PinboardT m a -> m (Either PinboardError a)
- pinboardJson :: (MonadPinboard m, FromJSON a) => PinboardRequest -> m a
- runPinboardSingleRaw :: MonadIO m => PinboardConfig -> PinboardRequest -> m (Either PinboardError (Response ByteString))
- runPinboardSingleRawBS :: MonadIO m => PinboardConfig -> PinboardRequest -> m (Either PinboardError ByteString)
- runPinboardSingleJson :: (Functor m, MonadIO m, FromJSON a) => PinboardConfig -> PinboardRequest -> m (Either PinboardError a)
- sendPinboardRequest :: MonadIO m => PinboardEnv -> PinboardRequest -> m (Response ByteString)
- newMgr :: MonadIO m => m Manager
- mgrFail :: MonadIO m => PinboardErrorType -> SomeException -> m (Either PinboardError b)
- parseJSONResponse :: (MonadError PinboardError m, FromJSON a) => Response ByteString -> m a
- decodeJSONResponse :: (MonadError PinboardError m, FromJSON a) => ByteString -> m a
- checkStatusCodeResponse :: Response a -> Either PinboardError ()
- checkStatusCode :: Int -> Either PinboardError ()
- addErrMsg :: Text -> PinboardError -> PinboardError
- createParserErr :: Text -> PinboardError
- httpStatusPinboardError :: PinboardErrorHTTPCode -> Either PinboardError a
- module Pinboard.Error
- module Pinboard.Types
- module Pinboard.Util
Config
fromApiToken :: String -> PinboardConfig Source
Create a default PinboardConfig using the supplied apiToken
The PinboardConfig provides authentication via apiToken
Monadic
runPinboard :: MonadIO m => PinboardConfig -> PinboardT m a -> m (Either PinboardError a) Source
Execute computations in the Pinboard monad
pinboardJson :: (MonadPinboard m, FromJSON a) => PinboardRequest -> m a Source
Create a Pinboard value from a PinboardRequest w/ json deserialization
Single
runPinboardSingleRaw :: MonadIO m => PinboardConfig -> PinboardRequest -> m (Either PinboardError (Response ByteString)) Source
runPinboardSingleRawBS :: MonadIO m => PinboardConfig -> PinboardRequest -> m (Either PinboardError ByteString) Source
runPinboardSingleJson :: (Functor m, MonadIO m, FromJSON a) => PinboardConfig -> PinboardRequest -> m (Either PinboardError a) Source
Sending
sendPinboardRequest :: MonadIO m => PinboardEnv -> PinboardRequest -> m (Response ByteString) Source
Manager (http-client)
mgrFail :: MonadIO m => PinboardErrorType -> SomeException -> m (Either PinboardError b) Source
JSON Handling
parseJSONResponse :: (MonadError PinboardError m, FromJSON a) => Response ByteString -> m a Source
decodeJSONResponse :: (MonadError PinboardError m, FromJSON a) => ByteString -> m 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.Error
module Pinboard.Types
module Pinboard.Util