Compare commits
110 Commits
v2.0.4-rc
...
b5ae3e4ed1
Author | SHA1 | Date | |
---|---|---|---|
b5ae3e4ed1 | |||
89a2d5866a | |||
5264d17ae8 | |||
1718464c60 | |||
85756ddd8c | |||
e8240948b7 | |||
77088e6608 | |||
ddbebef850 | |||
7cf636b8ed | |||
754dfc49db | |||
63b2d0e741 | |||
96ac72ae21 | |||
0bbf6b5942 | |||
74ef36956d | |||
bbe065819c | |||
3493054f1a | |||
743281497c | |||
eaa6a6f92e | |||
a25dd8178e | |||
71463bfee4 | |||
270df62dbe | |||
5bd7ded7d9 | |||
b5048a422f | |||
c27528fe73 | |||
c3978562d5 | |||
637892cff1 | |||
998a3d9d83 | |||
8ed8822625 | |||
196abaebcc | |||
653e8000ff | |||
ea362211aa | |||
a4a9d069d3 | |||
9cb7f9accf | |||
4e5454efb5 | |||
a8c3f31298 | |||
f3093c27cd | |||
4526a9d860 | |||
a1ada5aa8c | |||
1ae8b8b793 | |||
f44cc99a82 | |||
75657bec58 | |||
4fef036f10 | |||
ecb9783f4e | |||
bdf85908ca | |||
9cb3cdabb0 | |||
6cf082dfa7 | |||
1a140d4dfd | |||
1cc8571a04 | |||
cf8c631938 | |||
4cba2a16f9 | |||
7c5f074d5a | |||
a251cf6abf | |||
31f7a47889 | |||
23de2af98d | |||
2446f024ef | |||
45ddd528b2 | |||
36908f7da9 | |||
1a11d55782 | |||
e344eddbcb | |||
09da7a29a9 | |||
5b5ac0937c | |||
c69818fed6 | |||
81712e7a99 | |||
75d2d39e7c | |||
ccc4a30ad5 | |||
a9bb12015a | |||
474f90ee33 | |||
ae7d5fe284 | |||
bf700b9d59 | |||
0d4b3f5e7e | |||
67076458f0 | |||
a8479eefd1 | |||
e1eda99a72 | |||
ed4a4f0742 | |||
84e89d3b83 | |||
5e3efde376 | |||
f28e17f3e5 | |||
699ecafc22 | |||
247cc301ea | |||
bc43338127 | |||
4e86f2a7de | |||
b9fe2746e3 | |||
4fe9d09f0a | |||
777db300e1 | |||
62a303e856 | |||
ae573af89d | |||
0c41a3309e | |||
4cb3e22308 | |||
9d7d36922f | |||
3190c5f133 | |||
5fadb796d1 | |||
4a213e5ca5 | |||
9fea962563 | |||
ac6c333df3 | |||
4bbff47b6f | |||
f01daa4296 | |||
96c2f8ee1e | |||
9eb3e7a22d | |||
3c2c783683 | |||
2e24f9bb44 | |||
6bb3351cb8 | |||
6086a0ea12 | |||
b4b688d3b9 | |||
43bf3c0cb2 | |||
26897c256b | |||
a788563db6 | |||
9fb1c747a6 | |||
5982978879 | |||
5ca4584416 | |||
3eca1af971 |
@ -26,6 +26,7 @@ cppvsdbg
|
||||
create_notraverse
|
||||
crypto_aead_xchacha20poly1305_ietf_npubbytes
|
||||
cstdint
|
||||
curlopt_aws_sigv4
|
||||
cxxflags
|
||||
cxxstd
|
||||
d_largefile64_source
|
||||
@ -154,6 +155,7 @@ nlohmann_json
|
||||
nmakeprg
|
||||
nominmax
|
||||
ntstatus
|
||||
nullptr
|
||||
nuspell_version
|
||||
oleaut32
|
||||
openal_version
|
||||
|
25
CHANGELOG.md
25
CHANGELOG.md
@ -1,14 +1,37 @@
|
||||
# Changelog
|
||||
|
||||
## v2.0.3-rc
|
||||
|
||||
### Issues
|
||||
|
||||
* ~~\#12 \[Unit Test\] Complete all providers unit tests~~
|
||||
* ~~\#20 Add support to evict open files~~
|
||||
* ~~\#21 \[Unit Test \] Complete WinFSP unit tests~~
|
||||
* ~~\#22 \[Unit Test\] Complete FUSE unit tests~~
|
||||
* \#28 \[bug\] Address slow directory responses in S3 mounts for deeply nested directories
|
||||
* \#29 \[bug\] S3 error responses are not being logged
|
||||
* \#30 \[bug\] Sia provider error responses are not logged
|
||||
* ~~\#31 \[bug\] S3 provider should limit max key size to 1024~~
|
||||
|
||||
### Changes from v2.0.2-rc
|
||||
|
||||
* Always use direct for read-only providers
|
||||
* Fixed http headers not being added for requests
|
||||
* Fixed incorrect `stat` values for remote mounts
|
||||
* Fixed invalid directory nullptr error on remote mounts
|
||||
* Updated build system to Alpine 3.21.0
|
||||
* Updated build system to MinGW-w64 12.0.0
|
||||
* Updated copyright to 2018-2025
|
||||
|
||||
## v2.0.2-rc
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* Refactored `config.json` - will need to verify configuration settings prior to mounting
|
||||
|
||||
<!-- markdownlint-disable-next-line -->
|
||||
### Issues
|
||||
|
||||
* \#12 \[Unit Test\] Complete all providers unit tests
|
||||
* \#14 \[Unit Test\] SQLite mini-ORM unit tests and cleanup
|
||||
* \#16 Add support for bucket name in Sia provider
|
||||
* \#17 Update to common c++ build system
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Repertory MIT License
|
||||
### Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
### Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
|
@ -1,15 +1,15 @@
|
||||
set(BINUTILS_HASH ae9a5789e23459e59606e6714723f2d3ffc31c03174191ef0d015bdf06007450)
|
||||
set(BOOST_HASH f55c340aa49763b1925ccf02b2e83f35fdcf634c9d5164a2acb87540173c741d)
|
||||
set(BINUTILS_HASH b53606f443ac8f01d1d5fc9c39497f2af322d99e14cea5c0b4b124d630379365)
|
||||
set(BOOST2_HASH 7bd7ddceec1a1dfdcbdb3e609b60d01739c38390a5f956385a12f3122049f0ca)
|
||||
set(BOOST_HASH f55c340aa49763b1925ccf02b2e83f35fdcf634c9d5164a2acb87540173c741d)
|
||||
set(CPP_HTTPLIB_HASH 405abd8170f2a446fc8612ac635d0db5947c0d2e156e32603403a4496255ff00)
|
||||
set(CURL_HASH 5a231145114589491fc52da118f9c7ef8abee885d1cb1ced99c7290e9a352f07)
|
||||
set(EXPAT_HASH 372b18f6527d162fa9658f1c74d22a37429b82d822f5a1e1fc7e00f6045a06a2)
|
||||
set(GCC_HASH 7d376d445f93126dc545e2c0086d0f647c3094aae081cdb78f42ce2bc25e7293)
|
||||
set(GTEST_HASH 7b42b4d6ed48810c5362c265a17faebe90dc2373c885e5216439d37927f02926)
|
||||
set(ICU_HASH 925e6b4b8cf8856e0ac214f6f34e30dee63b7bb7a50460ab4603950eff48f89e)
|
||||
set(ICU_HASH a2c443404f00098e9e90acf29dc318e049d2dc78d9ae5f46efb261934a730ce2)
|
||||
set(JSON_HASH 0d8ef5af7f9794e3263480193c491549b2ba6cc74bb018906202ada498a79406)
|
||||
set(LIBSODIUM_HASH 8e5aeca07a723a27bbecc3beef14b0068d37e7fc0e97f51b3f1c82d2a58005c1)
|
||||
set(MINGW_HASH 3f66bce069ee8bed7439a1a13da7cb91a5e67ea6170f21317ac7f5794625ee10)
|
||||
set(MINGW_HASH 30e5aad2c48dd318150f79cff47661232c4175876d6b4d6b270961cf2b49a48b)
|
||||
set(OPENSSL_HASH e15dda82fe2fe8139dc2ac21a36d4ca01d5313c75f99f46c4e8a27709b7294bf)
|
||||
set(PKG_CONFIG_HASH 6fc69c01688c9458a57eb9a1664c9aba372ccda420a02bf4429fe610e7e7d591)
|
||||
set(PUGIXML_HASH 2f10e276870c64b1db6809050a75e11a897a8d7456c4be5c6b2e35a11168a015)
|
||||
|
@ -20,11 +20,13 @@ if(PROJECT_ENABLE_CURL)
|
||||
LIST_SEPARATOR |
|
||||
CMAKE_ARGS
|
||||
${PROJECT_EXTERNAL_CMAKE_FLAGS}
|
||||
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
|
||||
-DBUILD_STATIC_LIBS=ON
|
||||
-DBUILD_CURL_EXE=OFF
|
||||
-DBUILD_LIBCURL_DOCS=OFF
|
||||
-DBUILD_MISC_DOCS=OFF
|
||||
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
|
||||
-DBUILD_STATIC_CURL=ON
|
||||
-DBUILD_STATIC_LIBS=ON
|
||||
-DBUILD_STATIC_LIBS=ON
|
||||
-DBUILD_TESTING=OFF
|
||||
-DCURL_CA_BUNDLE=./cacert.pem
|
||||
-DCURL_CA_FALLBACK=ON
|
||||
@ -33,6 +35,7 @@ if(PROJECT_ENABLE_CURL)
|
||||
-DCURL_USE_LIBSSH2=OFF
|
||||
-DCURL_USE_OPENSSL=${PROJECT_ENABLE_OPENSSL}
|
||||
-DCURL_ZLIB=ON
|
||||
-DENABLE_CURL_MANUAL=OFF
|
||||
-DENABLE_THREADED_RESOLVER=ON
|
||||
-DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_DIR}
|
||||
-DOPENSSL_USE_STATIC_LIBS=${OPENSSL_USE_STATIC_LIBS}
|
||||
|
@ -1,4 +1,4 @@
|
||||
set(BINUTILS_VERSION 2.41)
|
||||
set(BINUTILS_VERSION 2.43)
|
||||
set(BOOST2_MAJOR_VERSION 1)
|
||||
set(BOOST2_MINOR_VERSION 76)
|
||||
set(BOOST2_PATCH_VERSION 0)
|
||||
@ -12,11 +12,11 @@ set(EXPAT2_VERSION 2_6_4)
|
||||
set(EXPAT_VERSION 2.6.4)
|
||||
set(GCC_VERSION 14.2.0)
|
||||
set(GTEST_VERSION 1.15.2)
|
||||
set(ICU_VERSION 75-1)
|
||||
set(ICU_VERSION 76-1)
|
||||
set(JSON_VERSION 3.11.3)
|
||||
set(LIBSODIUM_VERSION 1.0.20)
|
||||
set(MESA_VERSION 23.3.3)
|
||||
set(MINGW_VERSION 11.0.1)
|
||||
set(MINGW_VERSION 12.0.0)
|
||||
set(OPENSSL_VERSION 3.4.0)
|
||||
set(PKG_CONFIG_VERSION 0.29.2)
|
||||
set(PUGIXML_VERSION 1.14)
|
||||
|
@ -5,12 +5,12 @@ PROJECT_NAME="repertory"
|
||||
PROJECT_COMPANY_NAME="https://git.fifthgrid.com/blockstorage"
|
||||
PROJECT_URL="${PROJECT_COMPANY_NAME}/repertory"
|
||||
|
||||
PROJECT_COPYRIGHT="Copyright <2018-2024> <MIT License> <${PROJECT_URL}>"
|
||||
PROJECT_COPYRIGHT="Copyright <2018-2025> <MIT License> <${PROJECT_URL}>"
|
||||
PROJECT_DESC="Mount utility for Sia and S3"
|
||||
|
||||
PROJECT_MAJOR_VERSION=2
|
||||
PROJECT_MINOR_VERSION=0
|
||||
PROJECT_REVISION_VERSION=2
|
||||
PROJECT_REVISION_VERSION=3
|
||||
PROJECT_RELEASE_NUM=0
|
||||
PROJECT_RELEASE_ITER=rc
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM arm64v8/alpine:3.20.3
|
||||
FROM arm64v8/alpine:3.21.0
|
||||
MAINTAINER Scott E. Graves <scott.e.graves@protonmail.com>
|
||||
CMD bash
|
||||
|
||||
@ -30,7 +30,6 @@ RUN apk add \
|
||||
gflags \
|
||||
gflags-dev \
|
||||
git \
|
||||
gtkmm3-dev \
|
||||
icu-dev \
|
||||
icu-libs \
|
||||
icu-static \
|
||||
@ -69,7 +68,6 @@ RUN apk add \
|
||||
tcl \
|
||||
tcl-dev \
|
||||
texinfo \
|
||||
vlc-dev \
|
||||
wget \
|
||||
xz \
|
||||
xz-dev \
|
||||
@ -82,3 +80,6 @@ RUN apk add \
|
||||
zstd-libs \
|
||||
zstd-static \
|
||||
xz-static
|
||||
|
||||
RUN ln -sf /usr/bin/aclocal-1.17 /usr/bin/aclocal-1.16
|
||||
RUN ln -sf /usr/bin/automake-1.17 /usr/bin/automake-1.16
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM alpine:3.20.3
|
||||
FROM alpine:3.21.0
|
||||
MAINTAINER Scott E. Graves <scott.e.graves@protonmail.com>
|
||||
CMD bash
|
||||
|
||||
@ -80,3 +80,6 @@ RUN apk add \
|
||||
zstd-libs \
|
||||
zstd-static \
|
||||
xz-static
|
||||
|
||||
RUN ln -sf /usr/bin/aclocal-1.17 /usr/bin/aclocal-1.16
|
||||
RUN ln -sf /usr/bin/automake-1.17 /usr/bin/automake-1.16
|
||||
|
@ -1,5 +1,5 @@
|
||||
#comment
|
||||
FROM alpine:3.20.3
|
||||
FROM alpine:3.21.0
|
||||
|
||||
RUN apk update
|
||||
RUN apk upgrade
|
||||
@ -671,6 +671,8 @@ RUN if [ -f "/3rd_party/curl-${MY_CURL_VERSION}.tar.gz" ]; then \
|
||||
&& cd build \
|
||||
&& cmake .. \
|
||||
-DBUILD_CURL_EXE=ON \
|
||||
-DBUILD_LIBCURL_DOCS=OFF \
|
||||
-DBUILD_MISC_DOCS=OFF \
|
||||
-DBUILD_SHARED_LIBS=OFF \
|
||||
-DBUILD_STATIC_LIBS=ON \
|
||||
-DBUILD_TESTING=OFF \
|
||||
@ -684,6 +686,7 @@ RUN if [ -f "/3rd_party/curl-${MY_CURL_VERSION}.tar.gz" ]; then \
|
||||
-DCURL_USE_LIBSSH2=OFF \
|
||||
-DCURL_USE_OPENSSL=ON \
|
||||
-DCURL_ZLIB=ON \
|
||||
-DENABLE_CURL_MANUAL=OFF \
|
||||
-DENABLE_THREADED_RESOLVER=ON \
|
||||
-DOPENSSL_USE_STATIC_LIBS=ON \
|
||||
-DUSE_LIBIDN2=OFF \
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@ -61,13 +61,14 @@ public:
|
||||
[[nodiscard]] static auto reset_curl(CURL *curl_handle) -> CURL *;
|
||||
|
||||
public:
|
||||
[[nodiscard]] static auto
|
||||
construct_url(CURL *curl, const std::string &relative_path,
|
||||
const host_config &cfg) -> std::string;
|
||||
[[nodiscard]] static auto construct_url(CURL *curl,
|
||||
const std::string &relative_path,
|
||||
const host_config &cfg)
|
||||
-> std::string;
|
||||
|
||||
[[nodiscard]] static auto
|
||||
create_host_config(const s3_config &cfg,
|
||||
bool use_s3_path_style) -> host_config;
|
||||
[[nodiscard]] static auto create_host_config(const s3_config &cfg,
|
||||
bool use_s3_path_style)
|
||||
-> host_config;
|
||||
|
||||
[[nodiscard]] static auto url_encode(CURL *curl, const std::string &data,
|
||||
bool allow_slash) -> std::string;
|
||||
@ -75,8 +76,8 @@ public:
|
||||
template <typename request_type>
|
||||
[[nodiscard]] static auto
|
||||
make_encrypted_request(const host_config &cfg, const request_type &request,
|
||||
long &response_code,
|
||||
stop_type &stop_requested) -> bool {
|
||||
long &response_code, stop_type &stop_requested)
|
||||
-> bool {
|
||||
response_code = 0;
|
||||
|
||||
if (not request.decryption_token.has_value() ||
|
||||
@ -193,6 +194,16 @@ public:
|
||||
request.aws_service.value().c_str());
|
||||
}
|
||||
|
||||
curl_slist *header_list{nullptr};
|
||||
if (not request.headers.empty()) {
|
||||
for (const auto &header : request.headers) {
|
||||
header_list = curl_slist_append(
|
||||
header_list,
|
||||
fmt::format("{}: {}", header.first, header.second).c_str());
|
||||
}
|
||||
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, header_list);
|
||||
}
|
||||
|
||||
auto url = construct_url(curl, request.get_path(), cfg) + parameters;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
|
||||
|
||||
@ -200,6 +211,11 @@ public:
|
||||
|
||||
CURLcode curl_code{};
|
||||
curl_request.get_result(curl_code, response_code);
|
||||
|
||||
if (header_list != nullptr) {
|
||||
curl_slist_free_all(header_list);
|
||||
}
|
||||
|
||||
if (curl_code != CURLE_OK) {
|
||||
event_system::instance().raise<curl_error>(url, curl_code);
|
||||
return false;
|
||||
@ -215,26 +231,30 @@ public:
|
||||
public:
|
||||
void enable_s3_path_style(bool enable) override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
make_request(const curl::requests::http_delete &del, long &response_code,
|
||||
stop_type &stop_requested) const -> bool override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
make_request(const curl::requests::http_get &get, long &response_code,
|
||||
stop_type &stop_requested) const -> bool override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
make_request(const curl::requests::http_head &head, long &response_code,
|
||||
stop_type &stop_requested) const -> bool override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
make_request(const curl::requests::http_post &post_file, long &response_code,
|
||||
stop_type &stop_requested) const -> bool override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
make_request(const curl::requests::http_put_file &put_file,
|
||||
[[nodiscard]] auto make_request(const curl::requests::http_delete &del,
|
||||
long &response_code,
|
||||
stop_type &stop_requested) const -> bool override;
|
||||
stop_type &stop_requested) const
|
||||
-> bool override;
|
||||
|
||||
[[nodiscard]] auto make_request(const curl::requests::http_get &get,
|
||||
long &response_code,
|
||||
stop_type &stop_requested) const
|
||||
-> bool override;
|
||||
|
||||
[[nodiscard]] auto make_request(const curl::requests::http_head &head,
|
||||
long &response_code,
|
||||
stop_type &stop_requested) const
|
||||
-> bool override;
|
||||
|
||||
[[nodiscard]] auto make_request(const curl::requests::http_post &post_file,
|
||||
long &response_code,
|
||||
stop_type &stop_requested) const
|
||||
-> bool override;
|
||||
|
||||
[[nodiscard]] auto make_request(const curl::requests::http_put_file &put_file,
|
||||
long &response_code,
|
||||
stop_type &stop_requested) const
|
||||
-> bool override;
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@ -32,15 +32,15 @@ struct http_post final : http_request_base {
|
||||
auto operator=(const http_post &) -> http_post & = default;
|
||||
auto operator=(http_post &&) -> http_post & = default;
|
||||
|
||||
~http_post() override;
|
||||
~http_post() override = default;
|
||||
|
||||
std::optional<nlohmann::json> json;
|
||||
|
||||
[[nodiscard]] auto
|
||||
set_method(CURL *curl, stop_type & /*stop_requested*/) const -> bool override;
|
||||
[[nodiscard]] auto set_method(CURL *curl,
|
||||
stop_type & /*stop_requested*/) const
|
||||
-> bool override;
|
||||
|
||||
private:
|
||||
mutable curl_slist *headers{nullptr};
|
||||
mutable std::optional<std::string> json_str;
|
||||
};
|
||||
} // namespace repertory::curl::requests
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@ -51,7 +51,7 @@ struct http_request_base {
|
||||
bool allow_timeout{};
|
||||
std::optional<std::string> aws_service;
|
||||
std::optional<std::string> decryption_token{};
|
||||
http_headers headers{};
|
||||
mutable http_headers headers{};
|
||||
std::string path{};
|
||||
http_query_parameters query{};
|
||||
std::optional<http_range> range{};
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@ -69,21 +69,21 @@ private:
|
||||
|
||||
void put_client(std::shared_ptr<client> &cli);
|
||||
|
||||
[[nodiscard]] auto read_packet(client &cli, packet &response)
|
||||
-> packet::error_type;
|
||||
[[nodiscard]] auto read_packet(client &cli,
|
||||
packet &response) const -> packet::error_type;
|
||||
|
||||
void resolve();
|
||||
|
||||
public:
|
||||
[[nodiscard]] auto send(std::string_view method, std::uint32_t &service_flags)
|
||||
-> packet::error_type;
|
||||
[[nodiscard]] auto send(std::string_view method,
|
||||
std::uint32_t &service_flags) -> packet::error_type;
|
||||
|
||||
[[nodiscard]] auto send(std::string_view method, packet &request,
|
||||
std::uint32_t &service_flags) -> packet::error_type;
|
||||
|
||||
[[nodiscard]] auto send(std::string_view method, packet &request,
|
||||
packet &response, std::uint32_t &service_flags)
|
||||
-> packet::error_type;
|
||||
packet &response,
|
||||
std::uint32_t &service_flags) -> packet::error_type;
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@ -221,25 +221,44 @@ using WCHAR = wchar_t;
|
||||
|
||||
#define MAX_PATH 260
|
||||
|
||||
#define STATUS_SUCCESS std::uint32_t{0U}
|
||||
#define STATUS_ACCESS_DENIED std::uint32_t{0xC0000022L}
|
||||
#define STATUS_DEVICE_BUSY std::uint32_t{0x80000011L}
|
||||
#define STATUS_DEVICE_INSUFFICIENT_RESOURCES std::uint32_t{0xC0000468L}
|
||||
#define STATUS_DIRECTORY_NOT_EMPTY std::uint32_t{0xC0000101L}
|
||||
#define STATUS_FILE_IS_A_DIRECTORY std::uint32_t{0xC00000BAL}
|
||||
#define STATUS_FILE_TOO_LARGE std::uint32_t{0xC0000904L}
|
||||
#define STATUS_INSUFFICIENT_RESOURCES std::uint32_t{0xC000009AL}
|
||||
#define STATUS_INTERNAL_ERROR std::uint32_t{0xC00000E5L}
|
||||
#define STATUS_INVALID_ADDRESS std::uint32_t{0xC0000141L}
|
||||
#define STATUS_INVALID_HANDLE std::uint32_t{0xC0000006L}
|
||||
#define STATUS_INVALID_IMAGE_FORMAT std::uint32_t{0xC000007BL}
|
||||
#define STATUS_INVALID_PARAMETER std::uint32_t{0xC000000DL}
|
||||
#define STATUS_NO_MEMORY std::uint32_t{0xC0000017L}
|
||||
#define STATUS_NOT_IMPLEMENTED std::uint32_t{0xC0000002L}
|
||||
#define STATUS_OBJECT_NAME_EXISTS std::uint32_t{0x40000000L}
|
||||
#define STATUS_OBJECT_NAME_NOT_FOUND std::uint32_t{0xC0000034L}
|
||||
#define STATUS_OBJECT_PATH_INVALID std::uint32_t{0xC0000039L}
|
||||
#define STATUS_UNEXPECTED_IO_ERROR std::uint32_t{0xC00000E9L}
|
||||
#define STATUS_SUCCESS \
|
||||
std::uint32_t { 0U }
|
||||
#define STATUS_ACCESS_DENIED \
|
||||
std::uint32_t { 0xC0000022L }
|
||||
#define STATUS_DEVICE_BUSY \
|
||||
std::uint32_t { 0x80000011L }
|
||||
#define STATUS_DEVICE_INSUFFICIENT_RESOURCES \
|
||||
std::uint32_t { 0xC0000468L }
|
||||
#define STATUS_DIRECTORY_NOT_EMPTY \
|
||||
std::uint32_t { 0xC0000101L }
|
||||
#define STATUS_FILE_IS_A_DIRECTORY \
|
||||
std::uint32_t { 0xC00000BAL }
|
||||
#define STATUS_FILE_TOO_LARGE \
|
||||
std::uint32_t { 0xC0000904L }
|
||||
#define STATUS_INSUFFICIENT_RESOURCES \
|
||||
std::uint32_t { 0xC000009AL }
|
||||
#define STATUS_INTERNAL_ERROR \
|
||||
std::uint32_t { 0xC00000E5L }
|
||||
#define STATUS_INVALID_ADDRESS \
|
||||
std::uint32_t { 0xC0000141L }
|
||||
#define STATUS_INVALID_HANDLE \
|
||||
std::uint32_t { 0xC0000006L }
|
||||
#define STATUS_INVALID_IMAGE_FORMAT \
|
||||
std::uint32_t { 0xC000007BL }
|
||||
#define STATUS_INVALID_PARAMETER \
|
||||
std::uint32_t { 0xC000000DL }
|
||||
#define STATUS_NO_MEMORY \
|
||||
std::uint32_t { 0xC0000017L }
|
||||
#define STATUS_NOT_IMPLEMENTED \
|
||||
std::uint32_t { 0xC0000002L }
|
||||
#define STATUS_OBJECT_NAME_EXISTS \
|
||||
std::uint32_t { 0x40000000L }
|
||||
#define STATUS_OBJECT_NAME_NOT_FOUND \
|
||||
std::uint32_t { 0xC0000034L }
|
||||
#define STATUS_OBJECT_PATH_INVALID \
|
||||
std::uint32_t { 0xC0000039L }
|
||||
#define STATUS_UNEXPECTED_IO_ERROR \
|
||||
std::uint32_t { 0xC00000E9L }
|
||||
|
||||
#define CONVERT_STATUS_NOT_IMPLEMENTED(e) \
|
||||
((std::uint32_t(e) == STATUS_NOT_IMPLEMENTED) ? -ENOTSUP : e)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@ -31,7 +31,7 @@ class i_file_db {
|
||||
public:
|
||||
struct file_info final {
|
||||
std::string api_path;
|
||||
bool directory;
|
||||
bool directory{};
|
||||
std::string source_path;
|
||||
};
|
||||
|
||||
@ -56,6 +56,10 @@ public:
|
||||
|
||||
[[nodiscard]] virtual auto count() const -> std::uint64_t = 0;
|
||||
|
||||
virtual void enumerate_item_list(
|
||||
std::function<void(const std::vector<i_file_db::file_info> &)> callback,
|
||||
stop_type &stop_requested) const = 0;
|
||||
|
||||
[[nodiscard]] virtual auto get_api_path(const std::string &source_path,
|
||||
std::string &api_path) const
|
||||
-> api_error = 0;
|
||||
@ -80,7 +84,7 @@ public:
|
||||
get_file_source_path(const std::string &api_path,
|
||||
std::string &source_path) const -> api_error = 0;
|
||||
|
||||
[[nodiscard]] virtual auto get_item_list() const
|
||||
[[nodiscard]] virtual auto get_item_list(stop_type &stop_requested) const
|
||||
-> std::vector<file_info> = 0;
|
||||
|
||||
[[nodiscard]] virtual auto get_source_path(const std::string &api_path,
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@ -41,10 +41,7 @@ public:
|
||||
std::string source_path;
|
||||
};
|
||||
|
||||
struct upload_entry final {
|
||||
std::string api_path;
|
||||
std::string source_path;
|
||||
};
|
||||
using upload_entry = upload_active_entry;
|
||||
|
||||
public:
|
||||
[[nodiscard]] virtual auto add_resume(const resume_entry &entry) -> bool = 0;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@ -31,6 +31,10 @@ class i_meta_db {
|
||||
public:
|
||||
virtual void clear() = 0;
|
||||
|
||||
virtual void enumerate_api_path_list(
|
||||
std::function<void(const std::vector<std::string> &)> callback,
|
||||
stop_type &stop_requested) const = 0;
|
||||
|
||||
[[nodiscard]] virtual auto get_api_path(const std::string &source_path,
|
||||
std::string &api_path) const
|
||||
-> api_error = 0;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@ -67,50 +67,54 @@ private:
|
||||
rocksdb::Transaction *txn) -> rocksdb::Status;
|
||||
|
||||
public:
|
||||
[[nodiscard]] auto
|
||||
add_directory(const std::string &api_path,
|
||||
const std::string &source_path) -> api_error override;
|
||||
[[nodiscard]] auto add_directory(const std::string &api_path,
|
||||
const std::string &source_path)
|
||||
-> api_error override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
add_or_update_file(const i_file_db::file_data &data) -> api_error override;
|
||||
[[nodiscard]] auto add_or_update_file(const i_file_db::file_data &data)
|
||||
-> api_error override;
|
||||
|
||||
void clear() override;
|
||||
|
||||
[[nodiscard]] auto count() const -> std::uint64_t override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
get_api_path(const std::string &source_path,
|
||||
std::string &api_path) const -> api_error override;
|
||||
void enumerate_item_list(
|
||||
std::function<void(const std::vector<i_file_db::file_info> &)> callback,
|
||||
stop_type &stop_requested) const override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
get_directory_api_path(const std::string &source_path,
|
||||
std::string &api_path) const -> api_error override;
|
||||
[[nodiscard]] auto get_api_path(const std::string &source_path,
|
||||
std::string &api_path) const
|
||||
-> api_error override;
|
||||
|
||||
[[nodiscard]] auto get_directory_api_path(const std::string &source_path,
|
||||
std::string &api_path) const
|
||||
-> api_error override;
|
||||
|
||||
[[nodiscard]] auto get_directory_source_path(const std::string &api_path,
|
||||
std::string &source_path) const
|
||||
-> api_error override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
get_file_api_path(const std::string &source_path,
|
||||
std::string &api_path) const -> api_error override;
|
||||
[[nodiscard]] auto get_file_api_path(const std::string &source_path,
|
||||
std::string &api_path) const
|
||||
-> api_error override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
get_file_data(const std::string &api_path,
|
||||
i_file_db::file_data &data) const -> api_error override;
|
||||
[[nodiscard]] auto get_file_data(const std::string &api_path,
|
||||
i_file_db::file_data &data) const
|
||||
-> api_error override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
get_file_source_path(const std::string &api_path,
|
||||
std::string &source_path) const -> api_error override;
|
||||
[[nodiscard]] auto get_file_source_path(const std::string &api_path,
|
||||
std::string &source_path) const
|
||||
-> api_error override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
get_item_list() const -> std::vector<i_file_db::file_info> override;
|
||||
[[nodiscard]] auto get_item_list(stop_type &stop_requested) const
|
||||
-> std::vector<i_file_db::file_info> override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
get_source_path(const std::string &api_path,
|
||||
std::string &source_path) const -> api_error override;
|
||||
[[nodiscard]] auto get_source_path(const std::string &api_path,
|
||||
std::string &source_path) const
|
||||
-> api_error override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
remove_item(const std::string &api_path) -> api_error override;
|
||||
[[nodiscard]] auto remove_item(const std::string &api_path)
|
||||
-> api_error override;
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@ -80,6 +80,10 @@ private:
|
||||
public:
|
||||
void clear() override;
|
||||
|
||||
void enumerate_api_path_list(
|
||||
std::function<void(const std::vector<std::string> &)> callback,
|
||||
stop_type &stop_requested) const override;
|
||||
|
||||
[[nodiscard]] auto get_api_path(const std::string &source_path,
|
||||
std::string &api_path) const
|
||||
-> api_error override;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@ -53,6 +53,10 @@ public:
|
||||
|
||||
[[nodiscard]] auto count() const -> std::uint64_t override;
|
||||
|
||||
void enumerate_item_list(
|
||||
std::function<void(const std::vector<i_file_db::file_info> &)> callback,
|
||||
stop_type &stop_requested) const override;
|
||||
|
||||
[[nodiscard]] auto get_api_path(const std::string &source_path,
|
||||
std::string &api_path) const
|
||||
-> api_error override;
|
||||
@ -77,7 +81,7 @@ public:
|
||||
std::string &source_path) const
|
||||
-> api_error override;
|
||||
|
||||
[[nodiscard]] auto get_item_list() const
|
||||
[[nodiscard]] auto get_item_list(stop_type &stop_requested) const
|
||||
-> std::vector<i_file_db::file_info> override;
|
||||
|
||||
[[nodiscard]] auto get_source_path(const std::string &api_path,
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@ -50,6 +50,10 @@ private:
|
||||
public:
|
||||
void clear() override;
|
||||
|
||||
void enumerate_api_path_list(
|
||||
std::function<void(const std::vector<std::string> &)> callback,
|
||||
stop_type &stop_requested) const override;
|
||||
|
||||
[[nodiscard]] auto get_api_path(const std::string &source_path,
|
||||
std::string &api_path) const
|
||||
-> api_error override;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@ -60,10 +60,10 @@ public:
|
||||
void execute_action(const std::string &api_path,
|
||||
const execute_callback &execute);
|
||||
|
||||
[[nodiscard]] auto get_directory(std::uint64_t handle)
|
||||
-> std::shared_ptr<directory_iterator>;
|
||||
[[nodiscard]] auto
|
||||
get_directory(std::uint64_t handle) -> std::shared_ptr<directory_iterator>;
|
||||
|
||||
[[nodiscard]] auto remove_directory(const std::string &api_path)
|
||||
auto remove_directory(const std::string &api_path)
|
||||
-> std::shared_ptr<directory_iterator>;
|
||||
|
||||
void remove_directory(std::uint64_t handle);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@ -53,7 +53,7 @@ private:
|
||||
bool was_mounted_ = false;
|
||||
|
||||
private:
|
||||
void populate_stat(const remote::stat &r_stat, bool directory,
|
||||
static void populate_stat(const remote::stat &r_stat, bool directory,
|
||||
struct stat &unix_st);
|
||||
|
||||
protected:
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@ -39,7 +39,7 @@ E_SIMPLE3(debug_log, debug, true,
|
||||
std::string, data, data, E_FROM_STRING
|
||||
);
|
||||
|
||||
E_SIMPLE1(directory_removed, info, true,
|
||||
E_SIMPLE1(directory_removed, debug, true,
|
||||
std::string, api_path, ap, E_FROM_STRING
|
||||
);
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@ -42,8 +42,8 @@ public:
|
||||
direct_open_file(const direct_open_file &) noexcept = delete;
|
||||
direct_open_file(direct_open_file &&) noexcept = delete;
|
||||
auto operator=(direct_open_file &&) noexcept -> direct_open_file & = delete;
|
||||
auto
|
||||
operator=(const direct_open_file &) noexcept -> direct_open_file & = delete;
|
||||
auto operator=(const direct_open_file &) noexcept
|
||||
-> direct_open_file & = delete;
|
||||
|
||||
private:
|
||||
std::array<data_buffer, min_ring_size> ring_data_;
|
||||
@ -51,22 +51,26 @@ private:
|
||||
protected:
|
||||
[[nodiscard]] auto on_check_start() -> bool override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
on_chunk_downloaded(std::size_t /* chunk */,
|
||||
const data_buffer & /* buffer */) -> api_error override {
|
||||
[[nodiscard]] auto on_chunk_downloaded(std::size_t /* chunk */,
|
||||
const data_buffer & /* buffer */)
|
||||
-> api_error override {
|
||||
return api_error::success;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto
|
||||
on_read_chunk(std::size_t chunk, std::size_t read_size,
|
||||
[[nodiscard]] auto on_read_chunk(std::size_t chunk, std::size_t read_size,
|
||||
std::uint64_t read_offset, data_buffer &data,
|
||||
std::size_t &bytes_read) -> api_error override;
|
||||
std::size_t &bytes_read)
|
||||
-> api_error override;
|
||||
|
||||
[[nodiscard]] auto use_buffer(std::size_t chunk,
|
||||
std::function<api_error(data_buffer &)> func)
|
||||
-> api_error override;
|
||||
|
||||
public:
|
||||
[[nodiscard]] auto get_source_path() const -> std::string override {
|
||||
return "direct";
|
||||
}
|
||||
|
||||
[[nodiscard]] auto native_operation(native_operation_callback /* callback */)
|
||||
-> api_error override {
|
||||
return api_error::not_supported;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@ -53,19 +53,19 @@ private:
|
||||
i_file_manager *fm_{};
|
||||
|
||||
private:
|
||||
void add_all_items(const stop_type &stop_requested);
|
||||
void add_all_items(stop_type &stop_requested);
|
||||
|
||||
void process_removed_directories(std::deque<removed_item> removed_list,
|
||||
const stop_type &stop_requested);
|
||||
stop_type &stop_requested);
|
||||
|
||||
void process_removed_files(std::deque<removed_item> removed_list,
|
||||
const stop_type &stop_requested);
|
||||
stop_type &stop_requested);
|
||||
|
||||
void process_removed_items(const stop_type &stop_requested);
|
||||
void process_removed_items(stop_type &stop_requested);
|
||||
|
||||
void remove_deleted_items(const stop_type &stop_requested);
|
||||
void remove_deleted_items(stop_type &stop_requested);
|
||||
|
||||
void remove_unmatched_source_files(const stop_type &stop_requested);
|
||||
void remove_unmatched_source_files(stop_type &stop_requested);
|
||||
|
||||
protected:
|
||||
[[nodiscard]] static auto create_api_file(std::string path, std::string key,
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@ -82,7 +82,7 @@ private:
|
||||
const encrypt_config &cfg,
|
||||
std::string &api_path) const -> bool;
|
||||
|
||||
void remove_deleted_files(const stop_type &stop_requested);
|
||||
void remove_deleted_files(stop_type &stop_requested);
|
||||
|
||||
public:
|
||||
[[nodiscard]] auto create_directory(const std::string &api_path,
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@ -54,14 +54,18 @@ private:
|
||||
const std::string &object_name) const
|
||||
-> api_error;
|
||||
|
||||
[[nodiscard]] auto
|
||||
create_directory_object(const std::string &api_path,
|
||||
const std::string &object_name) const -> api_error;
|
||||
|
||||
[[nodiscard]] auto create_directory_paths(const std::string &api_path,
|
||||
const std::string &key) const
|
||||
-> api_error;
|
||||
|
||||
[[nodiscard]] auto create_file_extra(const std::string &api_path,
|
||||
api_meta_map &meta)
|
||||
-> api_error override;
|
||||
|
||||
[[nodiscard]] auto create_path_directories(const std::string &api_path,
|
||||
const std::string &key) const
|
||||
-> api_error;
|
||||
|
||||
[[nodiscard]] auto decrypt_object_name(std::string &object_name) const
|
||||
-> api_error;
|
||||
|
||||
@ -85,6 +89,9 @@ private:
|
||||
return s3_config_;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto set_meta_key(const std::string &api_path,
|
||||
api_meta_map &meta) -> api_error;
|
||||
|
||||
protected:
|
||||
[[nodiscard]] auto create_directory_impl(const std::string &api_path,
|
||||
api_meta_map &meta)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@ -41,9 +41,6 @@ private:
|
||||
std::atomic<bool> started_ = false;
|
||||
|
||||
private:
|
||||
// [[nodiscard]] bool check_authorization(const httpserver::http_request
|
||||
// &request);
|
||||
|
||||
[[nodiscard]] auto check_authorization(const httplib::Request &req) -> bool;
|
||||
|
||||
void handle_get_config(const httplib::Request &req, httplib::Response &res);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -41,6 +41,7 @@ constexpr const auto default_task_wait_ms{100U};
|
||||
constexpr const auto default_timeout_ms{60000U};
|
||||
constexpr const auto max_orphaned_file_retention_days{std::uint16_t(31U)};
|
||||
constexpr const auto max_ring_buffer_file_size{std::uint16_t(1024U)};
|
||||
constexpr const auto max_s3_object_name_length{1024U};
|
||||
constexpr const auto min_cache_size_bytes{
|
||||
std::uint64_t(100UL * 1024UL * 1024UL)};
|
||||
constexpr const auto min_download_timeout_secs{std::uint8_t(5U)};
|
||||
@ -200,6 +201,7 @@ enum class api_error {
|
||||
item_exists,
|
||||
item_not_found,
|
||||
more_data,
|
||||
name_too_long,
|
||||
no_disk_space,
|
||||
not_implemented,
|
||||
not_supported,
|
||||
@ -216,31 +218,33 @@ enum class api_error {
|
||||
|
||||
[[nodiscard]] auto api_error_from_string(std::string_view str) -> api_error;
|
||||
|
||||
[[nodiscard]] auto
|
||||
api_error_to_string(const api_error &error) -> const std::string &;
|
||||
[[nodiscard]] auto api_error_to_string(const api_error &error)
|
||||
-> const std::string &;
|
||||
|
||||
enum class database_type {
|
||||
rocksdb,
|
||||
sqlite,
|
||||
};
|
||||
[[nodiscard]] auto database_type_from_string(
|
||||
std::string type,
|
||||
database_type default_type = database_type::rocksdb) -> database_type;
|
||||
|
||||
[[nodiscard]] auto
|
||||
database_type_to_string(const database_type &type) -> std::string;
|
||||
database_type_from_string(std::string type,
|
||||
database_type default_type = database_type::rocksdb)
|
||||
-> database_type;
|
||||
|
||||
[[nodiscard]] auto database_type_to_string(const database_type &type)
|
||||
-> std::string;
|
||||
|
||||
enum class download_type {
|
||||
default_,
|
||||
direct,
|
||||
ring_buffer,
|
||||
};
|
||||
[[nodiscard]] auto download_type_from_string(
|
||||
std::string type,
|
||||
download_type default_type = download_type::default_) -> download_type;
|
||||
|
||||
[[nodiscard]] auto
|
||||
download_type_to_string(const download_type &type) -> std::string;
|
||||
download_type_from_string(std::string type,
|
||||
download_type default_type = download_type::default_)
|
||||
-> download_type;
|
||||
|
||||
[[nodiscard]] auto download_type_to_string(const download_type &type)
|
||||
-> std::string;
|
||||
|
||||
enum class exit_code : std::int32_t {
|
||||
success = 0,
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@ -40,7 +40,7 @@ public:
|
||||
struct polling_item final {
|
||||
std::string name;
|
||||
frequency freq;
|
||||
std::function<void(const stop_type &stop_requested)> action;
|
||||
std::function<void(stop_type &stop_requested)> action;
|
||||
};
|
||||
|
||||
public:
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@ -30,7 +30,7 @@ class app_config;
|
||||
class tasks final {
|
||||
public:
|
||||
struct task final {
|
||||
std::function<void(const stop_type &task_stopped)> action;
|
||||
std::function<void(stop_type &task_stopped)> action;
|
||||
};
|
||||
|
||||
class i_task {
|
||||
|
@ -1,59 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_UTILS_THROTTLE_HPP_
|
||||
#define REPERTORY_INCLUDE_UTILS_THROTTLE_HPP_
|
||||
|
||||
namespace repertory {
|
||||
class throttle final {
|
||||
public:
|
||||
throttle() : max_size_(10u) {}
|
||||
|
||||
explicit throttle(std::size_t max_size) : max_size_(max_size) {}
|
||||
|
||||
public:
|
||||
throttle(const throttle &) noexcept = delete;
|
||||
throttle(throttle &&) noexcept = delete;
|
||||
auto operator=(const throttle &) -> throttle & = delete;
|
||||
auto operator=(throttle &&) -> throttle & = delete;
|
||||
|
||||
public:
|
||||
~throttle() { shutdown(); }
|
||||
|
||||
private:
|
||||
const std::size_t max_size_;
|
||||
std::size_t count_ = 0u;
|
||||
bool shutdown_ = false;
|
||||
std::mutex mutex_;
|
||||
std::condition_variable notify_;
|
||||
|
||||
public:
|
||||
void decrement();
|
||||
|
||||
void increment_or_wait();
|
||||
|
||||
void reset();
|
||||
|
||||
void shutdown();
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
#endif // REPERTORY_INCLUDE_UTILS_THROTTLE_HPP_
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user