pipes-s3-0.2.0.0: A simple interface for streaming data to and from Amazon S3

Safe HaskellNone
LanguageHaskell2010

Pipes.Aws.S3

Contents

Description

A simple streaming interface to the AWS S3 storage service.

Synopsis

Documentation

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.

type ChunkSize = Int Source #

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