-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into improve-s3-credential-error-handling
- Loading branch information
Showing
6 changed files
with
203 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
#include "child_process.h" | ||
|
||
std::string CloudfuseMngr::getMountDir() { | ||
std::string CloudfuseMngr::getMountDir() | ||
{ | ||
return mountDir; | ||
} | ||
|
||
std::string CloudfuseMngr::getFileCacheDir() { | ||
std::string CloudfuseMngr::getFileCacheDir() | ||
{ | ||
return fileCacheDir; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,42 @@ | ||
#include <string> | ||
|
||
struct processReturn { | ||
int errCode; // 0 if successful, failed otherwise | ||
struct processReturn | ||
{ | ||
int errCode; // 0 if successful, failed otherwise | ||
std::string output; // std err and std out from cloudfuse command | ||
}; | ||
|
||
class CloudfuseMngr { | ||
public: | ||
class CloudfuseMngr | ||
{ | ||
public: | ||
CloudfuseMngr(); | ||
#ifdef _WIN32 | ||
#ifdef _WIN32 | ||
CloudfuseMngr(std::string mountDir, std::string configFile, std::string fileCachePath); | ||
processReturn dryRun(std::string passphrase); | ||
processReturn mount(std::string passphrase); | ||
processReturn genS3Config(std::string accessKeyId, std::string secretAccessKey, std::string region, std::string endpoint, std::string bucketName, std::string passphrase); | ||
#elif defined(__linux__) || defined(__APPLE__) | ||
processReturn genS3Config(std::string accessKeyId, std::string secretAccessKey, std::string region, | ||
std::string endpoint, std::string bucketName, std::string passphrase); | ||
#elif defined(__linux__) || defined(__APPLE__) | ||
CloudfuseMngr(std::string mountDir, std::string fileCacheDir, std::string configFile, std::string templateFile); | ||
processReturn dryRun(std::string accessKeyId, std::string secretAccessKey, std::string passphrase); | ||
processReturn mount(std::string accessKeyId, std::string secretAccessKey, std::string passphrase); | ||
processReturn genS3Config(std::string region, std::string endpoint, std::string bucketName, std::string passphrase); | ||
#endif | ||
#endif | ||
std::string getMountDir(); | ||
std::string getFileCacheDir(); | ||
processReturn unmount(); | ||
bool isInstalled(); | ||
bool isMounted(); | ||
private: | ||
|
||
private: | ||
std::string mountDir; | ||
std::string configFile; | ||
std::string fileCacheDir; | ||
std::string templateFile; | ||
#ifdef _WIN32 | ||
processReturn spawnProcess(wchar_t* argv, std::wstring envp); | ||
#ifdef _WIN32 | ||
processReturn spawnProcess(wchar_t *argv, std::wstring envp); | ||
processReturn encryptConfig(std::string passphrase); | ||
#elif defined(__linux__) || defined(__APPLE__) | ||
#elif defined(__linux__) || defined(__APPLE__) | ||
processReturn spawnProcess(char *const argv[], char *const envp[]); | ||
#endif | ||
#endif | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.