clean seafile api

This commit is contained in:
shell committed 2026-07-21 22:00:38 +08:00
1 parent 133424f5f8
commit 3e4694ceb5
14 files changed
+476 -290

No files matched your search

+50 -68
View File
@@ -23,94 +23,76 @@
namespace seafile::api {
class ISeaFileApi {
public:
virtual ~ISeaFileApi() = default;
class ISeaFileApi {
public:
virtual ~ISeaFileApi() = default;
virtual tl::expected<AuthToken, SeafileException>
authToken(
const std::string& username,
const std::string& password
) = 0;
virtual tl::expected<AuthToken, SeafileException>
auth(
const std::string &username,
const std::string &password
) = 0;
virtual tl::expected<ServerInfo, SeafileException>
serverInfo() const = 0;
virtual tl::expected<ServerInfo, SeafileException>
serverInfo() const = 0;
virtual tl::expected<DefaultRepo, SeafileException>
defaultRepo(
const std::string& token,
TokenType token_type
) const = 0;
virtual tl::expected<DefaultRepo, SeafileException>
defaultRepo() const = 0;
virtual tl::expected<RepoInfo, SeafileException>
repoInfo(
const std::string& repo_id,
const std::string& token,
TokenType token_type
) const = 0;
virtual tl::expected<RepoInfo, SeafileException>
repoInfo(
const std::string &repo_id
) const = 0;
virtual tl::expected<std::vector<RepoEntry>, SeafileException>
repoDir(
const std::string& repo_id,
const std::string& path,
const std::string& token,
TokenType token_type
) const = 0;
virtual tl::expected<std::vector<RepoEntry>, SeafileException>
repoDir(
const std::string &repo_id,
const std::string &path
) const = 0;
virtual tl::expected<std::vector<RepoInfo>, SeafileException>
repos(const std::string &type, const std::string &name_contains) const = 0;
virtual tl::expected<AccountInfo, SeafileException>
accountInfo(
const std::string& token,
TokenType token_type
) const = 0;
virtual tl::expected<AccountInfo, SeafileException>
accountInfo() const = 0;
virtual tl::expected<FileInfo, SeafileException>
fileDetail(
const std::string& repo_id,
const std::string& path,
const std::string& token,
TokenType token_type
) const = 0;
virtual tl::expected<FileInfo, SeafileException>
fileDetail(
const std::string &repo_id,
const std::string &path
) const = 0;
virtual tl::expected<std::string, SeafileException>
downloadFileUrl(
const std::string& repo_id,
const std::string& path,
const std::string& token,
TokenType token_type
) const = 0;
virtual tl::expected<std::string, SeafileException>
downloadFileUrl(
const std::string &repo_id,
const std::string &path
) const = 0;
virtual tl::expected<std::string, SeafileException>
downloadFile(
const std::string& repo_id,
const std::string& path,
std::optional<size_t> start,
std::optional<size_t> end,
const std::string& token,
TokenType token_type
) const = 0;
virtual tl::expected<std::string, SeafileException>
downloadFile(
const std::string &repo_id,
const std::string &path,
std::optional<size_t> start,
std::optional<size_t> end
) const = 0;
virtual tl::expected<DirInfo, SeafileException>
dirDetail(
const std::string& repo_id,
const std::string& path,
const std::string& token,
TokenType token_type
) const = 0;
};
virtual tl::expected<DirInfo, SeafileException>
dirDetail(
const std::string &repo_id,
const std::string &path
) const = 0;
};
}
#endif //SEADISK_SEAFILE_API_INTERFACE_HPP