casa-client-0.0.2: Client for Casa

Safe Haskell | Safe-Inferred
Language | Haskell2010

Casa.Client

Synopsis

- blobsSource :: (MonadThrow m, MonadResource m, MonadIO m) => SourceConfig -> ConduitT i (BlobKey, ByteString) m ()
- data SourceConfig = SourceConfig {
  - sourceConfigUrl :: !CasaRepoPrefix
  - sourceConfigBlobs :: !(HashMap BlobKey Int)
  - sourceConfigMaxBlobsPerRequest :: !Int
  }
- blobsSink :: (MonadIO m, MonadThrow m, MonadUnliftIO m) => CasaRepoPrefix -> ConduitT () ByteString m () -> m ()
- data CasaRepoPrefix
- parseCasaRepoPrefix :: String -> Either String CasaRepoPrefix
- thParserCasaRepo :: String -> Q Exp
- data PushException = PushBadHttpStatus Status
- data PullException
  - = AttoParseError ParseError
  - | BadHttpStatus Status
  - | TooManyReturnedKeys Int

# Documentation

blobsSource :: (MonadThrow m, MonadResource m, MonadIO m) => SourceConfig -> ConduitT i (BlobKey, ByteString) m () Source #

Make a source of blobs from a URL. Throws `PullException`.

data SourceConfig Source #

Configuration for sourcing blobs from the server.

Constructors

SourceConfig |

Fields

- sourceConfigUrl :: !CasaRepoPrefix

  URL to pull from.

- sourceConfigBlobs :: !(HashMap BlobKey Int)

  The blobs to pull.

- sourceConfigMaxBlobsPerRequest :: !Int

  Maximum number of blobs per request; we split requests into chunks of this number.

blobsSink :: (MonadIO m, MonadThrow m, MonadUnliftIO m) => CasaRepoPrefix -> ConduitT () ByteString m () -> m () Source #

A sink to push blobs to the server. Throws `PushException`.

data CasaRepoPrefix Source #

The URL prefix for a casa repo. Commonly: `https://casa.fpcomplete.com` Parsers will strip out a trailing slash.

#### Instances

Instances details

FromJSON CasaRepoPrefix Source # |
Instance details Defined in Casa.Client Methods parseJSON :: Value -> Parser CasaRepoPrefix Source # parseJSONList :: Value -> Parser [CasaRepoPrefix] Source #
Show CasaRepoPrefix Source # |
Instance details Defined in Casa.Client Methods showsPrec :: Int -> CasaRepoPrefix -> ShowS Source # show :: CasaRepoPrefix -> String Source # showList :: [CasaRepoPrefix] -> ShowS Source #
Lift CasaRepoPrefix Source # |
Instance details Defined in Casa.Client Methods lift :: Quote m => CasaRepoPrefix -> m Exp Source # liftTyped :: forall (m :: Type -> Type). Quote m => CasaRepoPrefix -> Code m CasaRepoPrefix Source #

parseCasaRepoPrefix :: String -> Either String CasaRepoPrefix Source #

Parse and normalize a Casa repo prefix.

thParserCasaRepo :: String -> Q Exp Source #

TH compile-time parser.

data PushException Source #

An exception from blob consuming/sending.

Constructors

PushBadHttpStatus Status |

#### Instances

Instances details

Exception PushException Source # |
Instance details Defined in Casa.Client Methods toException :: PushException -> SomeException Source # fromException :: SomeException -> Maybe PushException Source # displayException :: PushException -> String Source #
Show PushException Source # |
Instance details Defined in Casa.Client Methods showsPrec :: Int -> PushException -> ShowS Source # show :: PushException -> String Source # showList :: [PushException] -> ShowS Source #

data PullException Source #

An exception from blob consuming/sending.

Constructors

AttoParseError ParseError |
BadHttpStatus Status |
TooManyReturnedKeys Int |

#### Instances

Instances details

Exception PullException Source # |
Instance details Defined in Casa.Client Methods toException :: PullException -> SomeException Source # fromException :: SomeException -> Maybe PullException Source # displayException :: PullException -> String Source #
Show PullException Source # |
Instance details Defined in Casa.Client Methods showsPrec :: Int -> PullException -> ShowS Source # show :: PullException -> String Source # showList :: [PullException] -> ShowS Source #