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
- fromS3WithManager :: MonadSafe m => Manager -> 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
- toS3WithManager :: forall m a. MonadIO m => Manager -> 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
Note that this makes no attempt at reusing a Manager
and therefore may not
be very efficient for many small requests. See fromS3WithManager
for more
control over the Manager
used.
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.
Note that this makes no attempt at reusing a Manager
and therefore may not
be very efficient for many small requests. See fromS3WithManager
for more
control over the Manager
used.
fromS3WithManager :: MonadSafe m => Manager -> Configuration -> Bucket -> Object -> (Response (Producer ByteString m ()) -> Producer ByteString m a) -> Producer ByteString m a Source #
Download an object from S3 explicitly specifying an http-client
Manager
and aws
Configuration
(which provides credentials and logging
configuration).
This can be more efficient when submitting many small requests as it allows
re-use of the Manager
across requests. Note that the Manager
provided
must support TLS; such a manager can be created with
newManager
tlsManagerSettings
Convenient re-exports
responseBody :: Response body -> body #
Response body sent by the server.
Since 0.1.0
Uploading
These internally use the S3 multi-part upload interface to achieve streaming upload behavior.
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.
toS3' :: forall m a. MonadIO m => Configuration -> ChunkSize -> Bucket -> Object -> Producer ByteString m a -> m a Source #
Upload content to an S3 object, explicitly specifying an
Configuration
, which provides credentials and logging configuration.
toS3WithManager :: forall m a. MonadIO m => Manager -> Configuration -> ChunkSize -> Bucket -> Object -> Producer ByteString m a -> m a Source #
Download an object from S3 explicitly specifying an http-client
Manager
and aws
Configuration
(which provides credentials and logging
configuration).
This can be more efficient when submitting many small requests as it allows
re-use of the Manager
across requests. Note that the Manager
provided
must support TLS; such a manager can be created with
newManager
tlsManagerSettings