Skip to content

Commit 89171c2

Browse files
committed
Basic scaffolding for our S3 Client
1 parent d50ea34 commit 89171c2

4 files changed

Lines changed: 21 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ add_library(s3cpplib
2424
src/s3cpp/httpclient.cpp
2525
src/s3cpp/auth.cpp
2626
src/s3cpp/xml.cpp
27+
src/s3cpp/s3.cpp
2728
)
2829
target_include_directories(s3cpplib PUBLIC src)
2930
target_link_libraries(s3cpplib PUBLIC CURL::libcurl OpenSSL::Crypto)
@@ -36,6 +37,7 @@ add_executable(tests
3637
test/httpclient_test.cpp
3738
test/auth_test.cpp
3839
test/xml_test.cpp
40+
test/s3_test.cpp
3941
)
4042

4143
target_link_libraries(tests s3cpplib GTest::gtest_main GTest::gmock_main CURL::libcurl OpenSSL::Crypto)

src/s3cpp/s3.cpp

Whitespace-only changes.

src/s3cpp/s3.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include <s3cpp/auth.h>
2+
#include <s3cpp/xml.h>
3+
4+
class S3Client {
5+
public:
6+
S3Client(const std::string& access, const std::string& secret)
7+
: Client(HttpClient())
8+
, Signer(AWSSigV4Signer(access, secret))
9+
, Parser(XMLParser()) { }
10+
S3Client(const std::string& access, const std::string& secret, const std::string& region)
11+
: Client(HttpClient())
12+
, Signer(AWSSigV4Signer(access, secret, region))
13+
, Parser(XMLParser()) { }
14+
15+
private:
16+
HttpClient Client;
17+
AWSSigV4Signer Signer;
18+
XMLParser Parser;
19+
};

test/s3_test.cpp

Whitespace-only changes.

0 commit comments

Comments
 (0)