module Network.Minio
(
ConnectInfo(..)
, awsCI
, minioPlayCI
, connect
, Minio
, runMinio
, runResourceT
, MinioErr(..)
, MErrV(..)
, MError(..)
, Bucket
, Object
, BucketInfo(..)
, UploadId
, ObjectData(..)
, getService
, getLocation
, listObjects
, listIncompleteUploads
, listIncompleteParts
, fGetObject
, fPutObject
, putObjectFromSource
, getObject
) where
import Control.Monad.Trans.Resource (runResourceT)
import qualified Data.Conduit as C
import qualified Data.Conduit.Binary as CB
import Lib.Prelude
import Network.Minio.Data
import Network.Minio.ListOps
import Network.Minio.PutObject
import Network.Minio.S3API
fGetObject :: Bucket -> Object -> FilePath -> Minio ()
fGetObject bucket object fp = do
src <- getObject bucket object
src C.$$+- CB.sinkFileCautious fp
fPutObject :: Bucket -> Object -> FilePath -> Minio ()
fPutObject bucket object f = void $ putObject bucket object $
ODFile f Nothing
putObjectFromSource :: Bucket -> Object -> C.Producer Minio ByteString
-> Maybe Int64 -> Minio ()
putObjectFromSource bucket object src sizeMay = void $ putObject bucket object $
ODStream src sizeMay
getObject :: Bucket -> Object -> Minio (C.ResumableSource Minio ByteString)
getObject bucket object = snd <$> getObject' bucket object [] []