ores.storage.core

Table of Contents

1. Summary

ores.storage.core is where the bytes actually move. net/http_client is the synchronous Beast GET, PUT and DELETE that streams file bodies rather than buffering them; filesystem/archiver packs and extracts tar.gz trees through libarchive; and net/storage_transfer composes the two into the atomic and composite operations the callers use. messaging/ holds the handler that answers the operation set on NATS.

Every operation is synchronous and blocking, and the callers run them on background threads. The composite helpers stage through a temporary file under the system temporary directory.

2. Inputs

  • A local directory or file to pack, upload or download.
  • A storage endpoint: the HTTP base URL, a bucket name and an object key.
  • A tar.gz archive to extract.
  • An in-memory blob to upload, and the compressed bytes to decode on the way back.

3. Outputs

  • Files written to a local path, or objects written to the remote bucket.
  • Extracted directory trees.
  • The server's response body, for the uploads that read a server-computed checksum out of it.
  • Decompressed blobs in memory.

4. Entry points

  • include/ores.storage.core/net/storage_transfer.hpp — the composite helpers the callers use.
  • include/ores.storage.core/net/http_client.hpp — the GET, PUT and DELETE primitive.
  • include/ores.storage.core/filesystem/archiver.hpp — tar.gz pack and extract.
  • include/ores.storage.core/messaging/ — the NATS handler.

5. Build dependencies

What the shared component profile cannot know, declared here rather than hand-edited into the generated build file. Each block is spliced into its generated file after the profile's baseline.

6. Dependencies

  • ores.storage.api — the path helpers and protocol it serves.
  • ores.utility — gzip, for the in-memory blob transfers.
  • ores.platform — the scoped temporary file the composite helpers stage through.
  • LibArchive — the tar.gz pack and extract.
  • Boost.Beast and Boost.Asio — the HTTP client.

7. See also

find_package(LibArchive REQUIRED)

find_package(Boost REQUIRED)

target_link_libraries(${lib_target_name}
    PUBLIC
        ores.storage.api.lib
        ores.nats.lib
    PRIVATE
        ores.service.lib
        ores.platform.lib
        ores.utility.lib
        ores.security.lib
        faker-cxx::faker-cxx
        libfort::fort)

target_link_libraries(${lib_target_name}
    PRIVATE
        ores.database.lib
        ores.iam.api.lib
        LibArchive::LibArchive
        Boost::boost)
find_package(LibArchive REQUIRED)

target_link_libraries(${tests_target_name}
    PRIVATE
        ${lib_target_name}
        ores.testing.lib
        ores.logging.lib
        Catch2::Catch2
        faker-cxx::faker-cxx
        ores.openssl_cleanup
        Threads::Threads)

target_link_libraries(${tests_target_name}
    PRIVATE
        ores.platform.lib
        ores.utility.lib)

Emacs 29.3 (Org mode 9.6.15)