Safe Haskell | None |
---|---|
Language | Haskell2010 |
Internal constructors and helper functions. You should NOT use this module under normal circumstances!
- data SyncConfig = SyncConfig {}
- type SyncResult a = Either SyncError a
- newtype SyncM m a = SyncM {
- runSyncthing :: EitherT SyncError (ReaderT SyncConfig m) a
- class Monad m => MonadSync m where
- getMethod :: Options -> String -> m ByteString
- postMethod :: Options -> String -> Value -> m ByteString
- liftEither :: Monad m => EitherT SyncError (ReaderT SyncConfig m) a -> SyncM m a
- liftReader :: Monad m => ReaderT SyncConfig m a -> SyncM m a
- liftInner :: Monad m => m a -> SyncM m a
- liftLeft :: Monad m => SyncError -> SyncM m a
- liftRight :: Monad m => a -> SyncM m a
- type Param = (Text, Text)
- data HttpMethod
- data SyncRequest = SyncRequest {}
- query :: (MonadSync m, FromJSON a) => SyncRequest -> SyncM m a
- queryMaybe :: (MonadSync m, FromJSON a) => SyncRequest -> SyncM m (Maybe a)
- send :: MonadSync m => SyncRequest -> SyncM m ()
- get :: HttpMethod
- post :: ToJSON a => a -> HttpMethod
- getRequest :: SyncRequest
- postRequest :: SyncRequest
- data DeviceError
- data SyncError
- decodeDeviceError :: Text -> DeviceError
- decodeError :: ByteString -> Maybe SyncError
Configuration
data SyncConfig Source
The Syncthing configuration for specifying the Syncthing server, authentication, the API Key etc.
The Syncthing Monad
type SyncResult a = Either SyncError a Source
The result type of Syncthing requests.
The SyncM Monad represents one or multiple Syncthing requests.
SyncM | |
|
class Monad m => MonadSync m where Source
getMethod :: Options -> String -> m ByteString Source
postMethod :: Options -> String -> Value -> m ByteString Source
liftEither :: Monad m => EitherT SyncError (ReaderT SyncConfig m) a -> SyncM m a Source
liftReader :: Monad m => ReaderT SyncConfig m a -> SyncM m a Source
Requests
queryMaybe :: (MonadSync m, FromJSON a) => SyncRequest -> SyncM m (Maybe a) Source
send :: MonadSync m => SyncRequest -> SyncM m () Source
get :: HttpMethod Source
post :: ToJSON a => a -> HttpMethod Source
Error Handling
data DeviceError Source