This is a little update for people who follow news about Reduct Storage and its ecosystem.
I've just released a new version of the SDK which supports HTTP API v0.7.
The most important new feature is the IBucket::Query
method. It allows to iterate records for a given time interval:
using reduct::IBucket;
using reduct::IClient;
int main() {
auto client = IClient::Build("https://play.reduct-storage.dev");
// Create a bucket
auto [bucket, create_err] = client->GetOrCreateBucket("bucket");
if (create_err) {
std::cerr << "Error: " << create_err;
return -1;
}
// Walk through the data
err = bucket->Query("entry-1", std::nullopt, IBucket::Time::clock::now(), std::nullopt, [](auto&& record) {
std::string blob;
auto read_err = record.Read([&blob](auto chunk) {
blob.append(chunk);
return true;
});
if (!read_err) {
std::cout << "Read blob: " << blob;
}
return true;
});
}
You can use the library with CMake's FetchContet
macros or install it from the source:
git clone https://github.com/reduct-storage/reduct-cpp.git
cd reduct-cpp
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
sudo cmake --build . --target install
In your CMakeLists.txt:
find_package(ReductCpp 0.8.0)
find_package(ZLIB)
find_package(OpenSSL)
add_executable(you_app you_app.cc)
target_link_libraries(you_app ${REDUCT_CPP_LIBRARIES} ${ZLIB_LIBRARIES} OpenSSL::SSL OpenSSL::Crypto)
For more information, read here
Top comments (0)