Safe Haskell | None |
---|---|
Language | Haskell2010 |
A simple streaming interface to the AWS S3 storage service.
- newtype Bucket = Bucket Text
- newtype Object = Object Text
- fromS3 :: MonadSafe m => Bucket -> Object -> (Response (Producer ByteString m ()) -> Producer ByteString m a) -> Producer ByteString m a
- fromS3' :: MonadSafe m => Configuration -> Bucket -> Object -> (Response (Producer ByteString m ()) -> Producer ByteString m a) -> Producer ByteString m a
- responseBody :: Response body -> body
- type ChunkSize = Int
- toS3 :: forall m a. MonadIO m => ChunkSize -> Bucket -> Object -> Producer ByteString m a -> m a
- toS3' :: forall m a. MonadIO m => Configuration -> ChunkSize -> Bucket -> Object -> Producer ByteString m a -> m a
Documentation
An AWS S3 bucket name
An AWS S3 object name
Downloading
fromS3 :: MonadSafe m => Bucket -> Object -> (Response (Producer ByteString m ()) -> Producer ByteString m a) -> Producer ByteString m a Source
Download an object from S3
This initiates an S3 download, requiring that the caller provide a way to
construct a Producer
from the initial Response
to the request (allowing
the caller to, e.g., handle failure).
For instance to merely produced the content of the response,
fromS3
bucket object responseBody
fromS3' :: MonadSafe m => Configuration -> Bucket -> Object -> (Response (Producer ByteString m ()) -> Producer ByteString m a) -> Producer ByteString m a Source
Download an object from S3 explicitly specifying an aws
Configuration
,
which provides credentials and logging configuration.
Convenient re-exports
responseBody :: Response body -> body
Response body sent by the server.
Since 0.1.0
Uploading
To maintain healthy streaming uploads are performed in a chunked manner. This is the size of the upload chunk size. Due to S3 interface restrictions this must be at least five megabytes.
toS3 :: forall m a. MonadIO m => ChunkSize -> Bucket -> Object -> Producer ByteString m a -> m a Source
Upload content to an S3 object explicitly specifying an aws
Configuration
, which provides credentials and logging configuration.
toS3' :: forall m a. MonadIO m => Configuration -> ChunkSize -> Bucket -> Object -> Producer ByteString m a -> m a Source
Upload content to an S3 object.
This internally uses the S3 multi-part upload interface to achieve streaming upload behavior.