minio-hs/app/Main.hs
Aditya Manthramurthy 73a88143d5 GetObject s3api and fGetObject api
- Also updates to lts 6.27 (to be able to use sinkFileCautious)
2017-02-13 16:03:42 +05:30

38 lines
1002 B
Haskell

module Main where
import Protolude
import Network.Minio
-- import Network.Minio.S3API
import Control.Monad.Trans.Resource (runResourceT)
-- import qualified Data.Conduit as C
-- import qualified Data.Conduit.List as CL
-- import qualified Network.HTTP.Conduit as NC
main :: IO ()
main = do
mc <- connect defaultConnectInfo
t <- runResourceT $ runMinio mc $ do
res <- getService
print res
-- case res of
-- Left e -> print e
-- Right res1 -> mapM_ print res1
-- liftIO $ print $ NC.responseStatus res
-- liftIO $ print $ NC.responseHeaders res
-- liftIO print $ NC.responseHeaders <$> res
-- let bodyE = NC.responseBody <$> res
-- case bodyE of
-- Left x -> print x
-- Right body -> body C.$$+- CL.mapM_ putStrLn
-- body <- NC.responseBody <$> res
-- NC.responseBody res C.$$+- CL.mapM_ putStrLn
res <- getLocation "test1"
print res
fGetObject "test1" "passwd" "/tmp/passwd"
print "After runResourceT"
print t