git-annex/RemoveObject.hs
Joey Hess 1002c9448d playing with aws library
This is basically all I need to convert git-annex from hS3 to aws.

In particular, both GetObject and PutObject stream content w/o buffering it
in memory at all. \o/
2014-08-03 14:49:37 -04:00

19 lines
645 B
Haskell

{-# LANGUAGE OverloadedStrings #-}
import qualified Aws
import qualified Aws.S3 as S3
import Data.Conduit (($$+-))
import Data.Conduit.Binary (sinkFile)
import Network.HTTP.Conduit (withManager, responseBody)
import Control.Monad.IO.Class
main :: IO ()
main = do
Just creds <- Aws.loadCredentialsFromEnv
let cfg = Aws.Configuration Aws.Timestamp creds (Aws.defaultLog Aws.Debug)
let s3cfg = Aws.defServiceConfig :: S3.S3Configuration Aws.NormalQuery
withManager $ \mgr -> do
rsp <- Aws.pureAws cfg s3cfg mgr $
S3.DeleteObject "cloud-remote.pdf" "joeyh-test"
liftIO $ print "removal done"