(
credentials: &FtpCredentials,
file_name: &str,
file_path: Option<&str>,
)
| 74 | } |
| 75 | |
| 76 | pub async fn fetch_object( |
| 77 | credentials: &FtpCredentials, |
| 78 | file_name: &str, |
| 79 | file_path: Option<&str>, |
| 80 | ) -> Result<String, String> { |
| 81 | let response = get_object(credentials, file_name, file_path).await; |
| 82 | match response { |
| 83 | Ok(buffer) => { |
| 84 | let json = String::from_utf8(buffer); |
| 85 | match json { |
| 86 | Ok(json) => Ok(json), |
| 87 | Err(err) => Err(format!("Failed to parse json: {}", err)), |
| 88 | } |
| 89 | } |
| 90 | Err(err) => Err(format!("Failed to get json file: {}", err)), |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | pub async fn upload_object( |
| 95 | credentials: &FtpCredentials, |
no test coverage detected