diff options
Diffstat (limited to 'src/buildtool/serve_api/remote/serve_api.hpp')
-rw-r--r-- | src/buildtool/serve_api/remote/serve_api.hpp | 89 |
1 files changed, 44 insertions, 45 deletions
diff --git a/src/buildtool/serve_api/remote/serve_api.hpp b/src/buildtool/serve_api/remote/serve_api.hpp index 83b2f9d0..4717c8a0 100644 --- a/src/buildtool/serve_api/remote/serve_api.hpp +++ b/src/buildtool/serve_api/remote/serve_api.hpp @@ -42,86 +42,85 @@ class ServeApi final { return instance; } - [[nodiscard]] static auto RetrieveTreeFromCommit( - std::string const& commit, - std::string const& subdir = ".", - bool sync_tree = false) noexcept -> std::variant<bool, std::string> { - return Instance().stc_->ServeCommitTree(commit, subdir, sync_tree); + [[nodiscard]] auto RetrieveTreeFromCommit(std::string const& commit, + std::string const& subdir = ".", + bool sync_tree = false) + const noexcept -> std::variant<bool, std::string> { + return stc_->ServeCommitTree(commit, subdir, sync_tree); } - [[nodiscard]] static auto RetrieveTreeFromArchive( + [[nodiscard]] auto RetrieveTreeFromArchive( std::string const& content, std::string const& archive_type = "archive", std::string const& subdir = ".", std::optional<PragmaSpecial> const& resolve_symlinks = std::nullopt, - bool sync_tree = false) noexcept -> std::variant<bool, std::string> { - return Instance().stc_->ServeArchiveTree( + bool sync_tree = false) const noexcept + -> std::variant<bool, std::string> { + return stc_->ServeArchiveTree( content, archive_type, subdir, resolve_symlinks, sync_tree); } - [[nodiscard]] static auto RetrieveTreeFromDistdir( + [[nodiscard]] auto RetrieveTreeFromDistdir( std::shared_ptr<std::unordered_map<std::string, std::string>> const& distfiles, - bool sync_tree = false) noexcept -> std::variant<bool, std::string> { - return Instance().stc_->ServeDistdirTree(distfiles, sync_tree); + bool sync_tree = false) const noexcept + -> std::variant<bool, std::string> { + return stc_->ServeDistdirTree(distfiles, sync_tree); } - [[nodiscard]] static auto RetrieveTreeFromForeignFile( + [[nodiscard]] auto RetrieveTreeFromForeignFile( const std::string& content, const std::string& name, - bool executable) noexcept -> std::variant<bool, std::string> { - return Instance().stc_->ServeForeignFileTree(content, name, executable); + bool executable) const noexcept -> std::variant<bool, std::string> { + return stc_->ServeForeignFileTree(content, name, executable); } - [[nodiscard]] static auto ContentInRemoteCAS( - std::string const& content) noexcept -> bool { - return Instance().stc_->ServeContent(content); + [[nodiscard]] auto ContentInRemoteCAS( + std::string const& content) const noexcept -> bool { + return stc_->ServeContent(content); } - [[nodiscard]] static auto TreeInRemoteCAS( - std::string const& tree_id) noexcept -> bool { - return Instance().stc_->ServeTree(tree_id); + [[nodiscard]] auto TreeInRemoteCAS( + std::string const& tree_id) const noexcept -> bool { + return stc_->ServeTree(tree_id); } - [[nodiscard]] static auto CheckRootTree(std::string const& tree_id) noexcept + [[nodiscard]] auto CheckRootTree(std::string const& tree_id) const noexcept -> std::optional<bool> { - return Instance().stc_->CheckRootTree(tree_id); + return stc_->CheckRootTree(tree_id); } - [[nodiscard]] static auto GetTreeFromRemote( - std::string const& tree_id) noexcept -> bool { - return Instance().stc_->GetRemoteTree(tree_id); + [[nodiscard]] auto GetTreeFromRemote( + std::string const& tree_id) const noexcept -> bool { + return stc_->GetRemoteTree(tree_id); } - [[nodiscard]] static auto ServeTargetVariables( - std::string const& target_root_id, - std::string const& target_file, - std::string const& target) noexcept - -> std::optional<std::vector<std::string>> { - return Instance().tc_->ServeTargetVariables( - target_root_id, target_file, target); + [[nodiscard]] auto ServeTargetVariables(std::string const& target_root_id, + std::string const& target_file, + std::string const& target) + const noexcept -> std::optional<std::vector<std::string>> { + return tc_->ServeTargetVariables(target_root_id, target_file, target); } - [[nodiscard]] static auto ServeTargetDescription( - std::string const& target_root_id, - std::string const& target_file, - std::string const& target) noexcept -> std::optional<ArtifactDigest> { - return Instance().tc_->ServeTargetDescription( - target_root_id, target_file, target); + [[nodiscard]] auto ServeTargetDescription(std::string const& target_root_id, + std::string const& target_file, + std::string const& target) + const noexcept -> std::optional<ArtifactDigest> { + return tc_->ServeTargetDescription(target_root_id, target_file, target); } - [[nodiscard]] static auto ServeTarget(const TargetCacheKey& key, - const std::string& repo_key) noexcept + [[nodiscard]] auto ServeTarget(const TargetCacheKey& key, + const std::string& repo_key) const noexcept -> std::optional<serve_target_result_t> { - return Instance().tc_->ServeTarget(key, repo_key); + return tc_->ServeTarget(key, repo_key); } - [[nodiscard]] static auto CheckServeRemoteExecution() noexcept -> bool { - return Instance().cc_->CheckServeRemoteExecution(); + [[nodiscard]] auto CheckServeRemoteExecution() const noexcept -> bool { + return cc_->CheckServeRemoteExecution(); } - [[nodiscard]] static auto IsCompatible() noexcept -> std::optional<bool> { - return Instance().cc_->IsCompatible(); + [[nodiscard]] auto IsCompatible() const noexcept -> std::optional<bool> { + return cc_->IsCompatible(); } private: |