Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
util::S3Bucket Class Reference

Public Types

using ListObjectResult = util::Status
 
using ListObjectCb = std::function< void(size_t, absl::string_view)>
 Called with (size, key_name) pairs.
 

Public Member Functions

 S3Bucket (const AWS &aws, http::HttpsClientPool *pool)
 
ListObjectResult List (absl::string_view glob, bool fs_mode, ListObjectCb cb)
 Lists objects for a particular bucket. More...
 

Static Public Member Functions

static bool SplitToBucketPath (absl::string_view input, absl::string_view *bucket, absl::string_view *path)
 
static std::string ToFullPath (absl::string_view bucket, absl::string_view key_path)
 

Static Public Attributes

static const char * kRootDomain = "s3.amazonaws.com"
 

Detailed Description

Definition at line 22 of file s3.h.

Constructor & Destructor Documentation

◆ S3Bucket()

util::S3Bucket::S3Bucket ( const AWS aws,
http::HttpsClientPool pool 
)

Constructs S3 bucket handler. pool should point to the bucket dns we are working with since S3 has bucket centric API.

Definition at line 562 of file s3.cc.

Member Function Documentation

◆ List()

auto util::S3Bucket::List ( absl::string_view  glob,
bool  fs_mode,
ListObjectCb  cb 
)

Lists objects for a particular bucket.

In s3 the bucket is determined by the dns "mybucket.s3.amazonaws.com" so unlike in GCS, in S3 api the http pool dns destination determines which bucket we are going to list. glob contains the object prefix path not including the bucket part. if fs_mode is true returns all paths upto the delimeter '/'.

Definition at line 565 of file s3.cc.


The documentation for this class was generated from the following files: