SSS - S3 Toolkit 0.9.6
S3 client library and applications
Loading...
Searching...
No Matches
s3-client.h File Reference

declaration of functions and data types for sending S3 requests, signing URLs and downloading and uploading files. More...

#include "aws_sign.h"
#include "common.h"
#include "webclient.h"
#include <string>
#include <vector>
+ Include dependency graph for s3-client.h:
+ This graph shows which files directly or indirectly include this file:

Data Structures

struct  sss::S3Credentials
 S3 Credentials in AWS format. More...
 
struct  sss::S3ClientConfig
 Parameters for SendS3Request calls. More...
 
struct  sss::S3DataTransferConfig
 Parameters for calls to upload and download functions. More...
 
struct  sss::BucketValidation
 Returned from ValidateBucket function. More...
 

Typedefs

using sss::CharArray = std::vector< char >
 char array wrapping char* buffers used by libcurl
 
using sss::StringArray = std::vector< std::string >
 array of std::string objects
 
using sss::ETag = std::string
 ETag returned by upload requests.
 
using sss::UploadId = std::string
 multiplart upload id returned when starting a multipart uplaod operation
 

Functions

S3Credentials sss::GetS3Credentials (const std::string &fileName, std::string awsProfile)
 read S3 credentials from file in AWS S3 format (Toml).
 
BucketValidation sss::ValidateBucket (const std::string name)
 Validate bucket name. Bucket name restrictions: see https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-s3-bucket-naming-requirements.html.
 
Headers sss::ToMeta (const std::map< std::string, std::string > &metaData)
 Translate metadata (key,value) pairs to amz- format and return header map which can be merged with other headers using the std::map::merge method, since C++17.
 
void sss::Validate (const S3ClientConfig &s)
 Validate S3 client request parameters.
 
WebClient sss::SendS3Request (S3ClientConfig cfg)
 Send S3 request to endpoint.
 
ETag sss::Upload (const S3DataTransferConfig &cfg, const MetaDataMap &mm={}, bool sync=false)
 Parallel upload If cfg.data not NULL data is read from memory, from file specified in cfg.file instead.
 
void sss::Download (const S3DataTransferConfig &cfg, bool sync=false, const std::string &versionId="")
 Parallel upload If cfg.data not NULL data is written into cfg.data buffer, to file specified in cfg.file instead.
 

Detailed Description

declaration of functions and data types for sending S3 requests, signing URLs and downloading and uploading files.