pipes-s3-0.1.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

newtype Bucket Source

An AWS S3 bucket name

Constructors

Bucket Text 

newtype Object Source

An AWS S3 object name

Constructors

Object Text 

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

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 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.