Skip to content

Commit

Permalink
v 0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Zocca committed Jun 25, 2023
1 parent 1e03baf commit 05038a6
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions ms-azure-api/src/MSAzureAPI/StorageServices/FileService.hs
Original file line number Diff line number Diff line change
Expand Up @@ -147,23 +147,23 @@ listDirectoriesAndFiles acct fshare fpath mm atok = do
Just m -> ("marker" ==: m)
_ -> mempty

-- | Repeated call of 'listDirectoriesAndFiles' supporting multi-page results
listDirectoriesAndFilesC :: MonadIO m =>
Text -- ^ storage account
-> Text -- ^ file share
-> Text -- ^ directory path, including directories
-> AccessToken -> C.ConduitT i [DirItem] m ()
listDirectoriesAndFilesC acct fshare fpath atok = go Nothing
where
go mm = do
eres <- runReq defaultHttpConfig $ tryReq $ listDirectoriesAndFiles acct fshare fpath mm atok
case eres of
Left _ -> undefined -- FIXME http exception
Right xe -> case xe of
Left _ -> undefined -- FIXME xml parsing error
Right (DirItems xs nMarker) -> do
C.yield xs
when (isJust nMarker) (go nMarker)
-- -- | Repeated call of 'listDirectoriesAndFiles' supporting multi-page results
-- listDirectoriesAndFilesC :: MonadIO m =>
-- Text -- ^ storage account
-- -> Text -- ^ file share
-- -> Text -- ^ directory path, including directories
-- -> AccessToken -> C.ConduitT i [DirItem] m ()
-- listDirectoriesAndFilesC acct fshare fpath atok = go Nothing
-- where
-- go mm = do
-- eres <- runReq defaultHttpConfig $ tryReq $ listDirectoriesAndFiles acct fshare fpath mm atok
-- case eres of
-- Left _ -> undefined -- FIXME http exception
-- Right xe -> case xe of
-- Left _ -> undefined -- FIXME xml parsing error
-- Right (DirItems xs nMarker) -> do
-- C.yield xs
-- when (isJust nMarker) (go nMarker)

-- | Directory item, as returned by 'listDirectoriesAndFiles'
data DirItem = DIFile {diId :: Text, diName :: Text} -- ^ file
Expand Down

0 comments on commit 05038a6

Please sign in to comment.