-
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.
- Loading branch information
1 parent
7b826b4
commit 8268d98
Showing
9 changed files
with
97 additions
and
25 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
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,18 +1,21 @@ | ||
use ingestion::mongo_utils::MongoDriver; | ||
use dpw | ||
use ingestion::downloader::GitHubDownloader; | ||
|
||
|
||
#[tokio::main] | ||
async fn main() -> std::io::Result<()> { | ||
let mongo: MongoDriver = MongoDriver::new("localhost", 8080, "turbine"); | ||
mongo.connect().await?; | ||
|
||
// create/connect if exists, and flush | ||
mongo.create_collection("github_data").await?; | ||
mongo.flush_collection("github_data").await?; | ||
let collection = "github_data" | ||
mongo.create_collection(collection).await?; | ||
mongo.flush_collection(collection).await?; | ||
|
||
// set remote urls and download | ||
// set download links and ingest | ||
let urls = vec!["https://github.com/user/repo/raw/master/file1.zip", "https://github.com/user/repo/raw/master/file2.zip"]; | ||
github_downloader.download_git_zips(urls, "my_repo").await?; | ||
|
||
|
||
let downloader: GithubDownloader = GithubDownloader::new(mongo, collection); | ||
downloader.download_git_zips(urls).await?; | ||
Ok(()) | ||
} |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#[tokio::test] | ||
async fn mongo_connection() { | ||
|
||
assert_eq!(Some(0), Some(0)); | ||
} |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
mod ing_tests; |