-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
* feat: added a dynamo client * feat: updated s3 client * feat: added a shared crate * chore: added .gitignore * feat: add a traits into the shared trait * docs: document * feat: updated s3 client * feat: added a dynamo db client
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
pub mod client { | ||
use shared::traits::GetFileListTrait; | ||
|
||
pub struct DynamoDbClient {} | ||
|
||
pub trait DynamoClientTrait : GetFileListTrait {} | ||
|
||
impl GetFileListTrait for DynamoDbClient { | ||
async fn get_years() -> Result<Vec<String>, String> { | ||
Ok(vec![]) | ||
} | ||
|
||
async fn get_month(years: usize) -> Result<Vec<String>, String> { | ||
todo!() | ||
} | ||
|
||
async fn get_days(year: usize, month: usize) -> Result<Vec<String>, String> { | ||
Check failure on line 17 in crates/aws_clients/src/dynamodb/mod.rs GitHub Actions / build a web API document
|
||
todo!() | ||
} | ||
|
||
async fn get_objects(year: usize, month: usize, day: usize) -> Result<Vec<String>, String>{ | ||
Check failure on line 21 in crates/aws_clients/src/dynamodb/mod.rs GitHub Actions / build a web API document
Check failure on line 21 in crates/aws_clients/src/dynamodb/mod.rs GitHub Actions / build a web API document
|
||
todo!() | ||
} | ||
} | ||
|
||
impl DynamoClientTrait for DynamoDbClient {} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
mod environment_values; | ||
pub mod s3; | ||
pub mod dynamodb; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.idea | ||
target |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[package] | ||
name = "shared" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
//! This is a shared crate. | ||
//! This crate contains general things that are used in the whole system | ||
pub mod traits { | ||
use std::future::Future; | ||
|
||
/// The searching is shared in the DB and bucket | ||
/// This trait defines basic access patterns | ||
pub trait GetFileListTrait { | ||
/// get years list | ||
fn get_years() -> impl Future<Output = Result<Vec<String>, String>> + Send; | ||
/// get months list | ||
fn get_month(years: usize) -> impl Future<Output = Result<Vec<String>, String>> + Send; | ||
/// get days list | ||
fn get_days( | ||
year: usize, | ||
month: usize, | ||
) -> impl Future<Output = Result<Vec<String>, String>> + Send; | ||
/// get objects list | ||
fn get_objects( | ||
year: usize, | ||
month: usize, | ||
day: usize, | ||
) -> impl Future<Output = Result<Vec<String>, String>> + Send; | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.