惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

有赞技术团队
有赞技术团队
小众软件
小众软件
The Cloudflare Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园_首页
酷 壳 – CoolShell
酷 壳 – CoolShell
爱范儿
爱范儿
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
雷峰网
雷峰网
Jina AI
Jina AI
博客园 - 【当耐特】
V
Visual Studio Blog
美团技术团队
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
罗磊的独立博客
大猫的无限游戏
大猫的无限游戏
量子位
IT之家
IT之家
G
Google Developers Blog
V
V2EX
The GitHub Blog
The GitHub Blog
月光博客
月光博客
GbyAI
GbyAI

Show HN

GitHub - astefanutti/shaderbang: Shebang for Shaders Show HN: Generate Claude Code Workflows using Spec Driven Development approach Show HN: AI agents for UK GDAD PCF roles and their skills The Two Pillars: Mixer Mode and Meta-Software in the Reorganization of Software Work After AI GitHub - JaiCode08/teleport-env What 1,000+ Harness Experiments Taught Me About Self-Improving Agents Show HN: Liiists, a Markdown-first, iOS and CLI list app SwiperTab – Get this Extension for 🦊 Firefox (en-US) GitHub - kouhxp/fftext: Summarize, explain, fact-check, or translate any text, URL, or file. No GPU. No cloud. One command GitHub - sweetpad-dev/sweetpad: Develop Swift/iOS projects using VSCode GitHub - dogmaticdev/IRON: IRON a.k.a. Intermediate Representation Object Notation is a Interpreter/Database that is used to create Programming Languages. GitHub - sjhalani7/vaen: Package your AI coding harness into a portable .agent file, and share it across repos, teams, & the community without ever having to copy-paste instructions, skills, MCP config, or secrets. Show HN: Gandalf the Grader Show HN: Citadeld – replay any CI failure locally from a single file GitHub - tdortman/cuSBF: High-Performance GPU Super Bloom Filter coral-ai/claude-code-token-xray at main · Coral-Bricks-AI/coral-ai GitHub - ulyssestenn/funes: Funes is a Git-based framework for LLM-managed knowledge work: an AI Librarian ingests raw sources, builds an interlinked Markdown knowledge base, and uses it to produce cited reports, analyses, and other outputs. GitHub - ThatXliner/gah: Git Add Hunk, built for agents to use GitHub - harmont-dev/harmont-cli: Command-line client for the Harmont CI platform GitHub - brooksmcmillin/mcp-authflow: OAuth 2.0 Authorization Server framework for MCP servers GitHub - javaid-codes/audit-supply-chain-agents GitHub - amorey/gochan: A small library of common channel architectures for Go, inspired by Rust GitHub - arifozgun/OpenGem: Free, Open-Source AI API Gateway with Gemini, OpenAI & Anthropic Compatibility in 1 file GitHub - Pranesh950/BioPetals: 🌸 Run BIOxAI models at home, BitTorrent-style. Fine-tuning and inference up to 10x faster than offloading GitHub - cnguyen14/bounty-doctor: Diagnose a GitHub bounty issue before you waste hours: detects honeypot scam repos, AI-bot attempt swarms, and stale contests. Show HN: CoreMCP – MCP Server for On-Prem DBs Show HN: KittyHTML – Render HTML/CSS as an inline image in your terminal GitHub - bingud/filemat: Web-based file manager Show HN: TruthLens – Free multi-signal deepfake image detector GitHub - apexlocal-jz/claude-usage-tray: Windows system-tray app showing your Claude Code rate-limit usage at a glance. Zero deps, ~300 lines of PowerShell. Cross-IDE (works regardless of VS Code, Cursor, plain terminal).
GitHub - ggcr/s3cpp: Lightweight C++23 client library for...
ggcr · 2026-06-14 · via Show HN

A lightweight C++ client library for AWS S3 with zero deps (only libcurl and OpenSSL)

Note

This is a project I did in my spare time to learn and explore modern C++ :) Not production-ready

benchmark

For a performance comparison against other AWS SDKs on a small set of sequential tasks, see benchmark/README.md

Architecture

Each S3 Client is organized onto modular components:

  • src/s3cpp/httpclient
  • src/s3cpp/auth: AWS Signature V4 auth protocol
  • src/s3cpp/xml: A custom FSM for parsing valid XML

Basic Usage

Create a bucket:

#include <s3cpp/s3.h>

int main() {
    s3cpp::S3Client client("access_key", "secret_key");

    auto result = client.CreateBucket("my-bucket", {
        .LocationConstraint = "us-east-1"
    });

    if (!result) {
        std::println("Error: {}", result.error().Message);
        return 1;
    }
    return 0;
}

List all buckets:

#include <s3cpp/s3.h>

int main() {
    s3cpp::S3Client client("access_key", "secret_key");

    auto result = client.ListBuckets();

    if (!result) {
        std::println("Error: {}", result.error().Message);
        return 1;
    }

    for (const auto& bucket : result->Buckets) {
        std::println("Bucket: {}, Created: {}", bucket.Name, bucket.CreationDate);
    }
    return 0;
}

List objects in a bucket:

#include <s3cpp/s3.h>

int main() {
    s3cpp::S3Client client("access_key", "secret_key");

    // List 100 objects with a prefix
    auto result = client.ListObjects("my-bucket", {
        .MaxKeys = 100,
        .Prefix = "path/to/"
    });

    if (!result) {
        std::println("Error: {}", result.error().Message);
        return 1;
    }

    for (const auto& obj : result->Contents) {
        std::println("Key: {}, Size: {}", obj.Key, obj.Size);
    }
    return 0;
}

For buckets with many objects, use the paginator to automatically handle continuation tokens:

#include <s3cpp/s3.h>

int main() {
    s3cpp::S3Client client("access_key", "secret_key");
    s3cpp::ListObjectsPaginator paginator(client, "my-bucket", "path/to/", 100);

    int totalObjects = 0;

    while (paginator.HasMorePages()) {
        std::expected<s3cpp::ListObjectsResult, s3cpp::Error> page = paginator.NextPage();

        if (!page) {
            std::println("Error: {}", page.error().Message);
            return 1;
        }

        totalObjects += page->KeyCount;

        for (const auto& obj : page->Contents) {
            std::println("Key: {}", obj.Key);
        }
    }
    return 0;
}

Checking if a bucket exists:

#include <s3cpp/s3.h>

bool BucketExists(s3cpp::S3Client& client, const std::string& bucketName) {
    auto result = client.HeadBucket(bucketName);
    return result.has_value();
}

int main() {
    s3cpp::S3Client client("access_key", "secret_key");
    
    if (BucketExists(client, "my-bucket")) {
        std::println("Bucket exists");
    } else {
        std::println("Bucket does not exist");
    }
    
    return 0;
}

Delete a non-empty bucket:

#include <s3cpp/s3.h>

int main() {
    s3cpp::S3Client client("access_key", "secret_key");

    // To delete a bucket we first need to delete all its contents
    s3cpp::ListObjectsPaginator paginator(client, "my-bucket", "", 1000);

    while (paginator.HasMorePages()) {
        auto page = paginator.NextPage();

        if (!page) {
            std::println("Error listing objects: {}", page.error().Message);
            return 1;
        }

        for (const auto& obj : page->Contents) {
            auto result = client.DeleteObject("my-bucket", obj.Key);
            if (!result) {
                std::println("Error deleting {}: {}", obj.Key, result.error().Message);
                return 1;
            }
        }
    }

    auto result = client.DeleteBucket("my-bucket");
    if (!result) {
        std::println("Error deleting bucket: {}", result.error().Message);
        return 1;
    }

    std::println("Bucket deleted successfully");
    return 0;
}

Build and Test

cmake -B build -DCMAKE_BUILD_TYPE=Debug
cmake --build build
./build/tests

Some tests require a local MinIO container to be running:

$ docker build -t s3cpp-minio:latest .
$ docker run -d -p 9000:9000 -p 9001:9001 \
  -e "MINIO_ROOT_USER=minio_access" \
  -e "MINIO_ROOT_PASSWORD=minio_secret" \
  s3cpp-minio:latest \
  server /data --console-address ":9001"

The full test suite contains 63 tests