-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Client for Casa
--   
--   Client for Casa (Content-Addressable Storage Archive). See
--   <a>https://casa.stackage.org/</a>
@package casa-client
@version 0.0.3


-- | Types and functions for a client for Casa (Content-addressable Storage
--   Archive).
module Casa.Client

-- | Make a source of blobs from a URL. Throws <a>PullException</a>.
blobsSource :: forall (m :: Type -> Type) i. (MonadThrow m, MonadResource m, MonadIO m) => SourceConfig -> ConduitT i (BlobKey, ByteString) m ()

-- | Configuration for sourcing blobs from the server.
data SourceConfig
SourceConfig :: !CasaRepoPrefix -> !HashMap BlobKey Int -> !Int -> SourceConfig

-- | URL to pull from.
[sourceConfigUrl] :: SourceConfig -> !CasaRepoPrefix

-- | The blobs to pull.
[sourceConfigBlobs] :: SourceConfig -> !HashMap BlobKey Int

-- | Maximum number of blobs per request; we split requests into chunks of
--   this number.
[sourceConfigMaxBlobsPerRequest] :: SourceConfig -> !Int

-- | A sink to push blobs to the server. Throws <a>PushException</a>.
blobsSink :: (MonadIO m, MonadThrow m, MonadUnliftIO m) => CasaRepoPrefix -> ConduitT () ByteString m () -> m ()

-- | The URL prefix for a Casa repository, commonly
--   <tt><a>https://casa.stackage.org</a></tt>. Parsers will strip out a
--   trailing slash.
data CasaRepoPrefix

-- | Parse and normalize a Casa repo prefix.
parseCasaRepoPrefix :: String -> Either String CasaRepoPrefix

-- | TH compile-time parser.
thParserCasaRepo :: String -> Q Exp

-- | An exception from blob consuming/sending.
newtype PushException
PushBadHttpStatus :: Status -> PushException

-- | An exception from blob consuming/sending.
data PullException
AttoParseError :: ParseError -> PullException
BadHttpStatus :: Status -> PullException
TooManyReturnedKeys :: Int -> PullException
instance GHC.Internal.Exception.Type.Exception Casa.Client.PullException
instance GHC.Internal.Exception.Type.Exception Casa.Client.PushException
instance Data.Aeson.Types.FromJSON.FromJSON Casa.Client.CasaRepoPrefix
instance Language.Haskell.TH.Syntax.Lift Casa.Client.CasaRepoPrefix
instance GHC.Internal.Show.Show Casa.Client.CasaRepoPrefix
instance GHC.Internal.Show.Show Casa.Client.PullException
instance GHC.Internal.Show.Show Casa.Client.PushException
