diff options
author | Alex Auvolat <alex@adnab.me> | 2022-05-18 12:24:37 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-05-18 12:26:50 +0200 |
commit | 7a3ce9f81963cc374271272bfe4e0e204e9b7012 (patch) | |
tree | 369a1c390d5aeb5f3ce2515b677affca366cc328 /src/main.rs | |
download | aerogramme-7a3ce9f81963cc374271272bfe4e0e204e9b7012.tar.gz aerogramme-7a3ce9f81963cc374271272bfe4e0e204e9b7012.zip |
Skeleton for some stuff
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..2b17e4c --- /dev/null +++ b/src/main.rs @@ -0,0 +1,47 @@ +use anyhow::Result; + +use rusoto_credential::{EnvironmentProvider, ProvideAwsCredentials}; +use rusoto_signature::Region; + +mod bayou; +mod cryptoblob; +mod time; +mod uidindex; + +use bayou::Bayou; +use cryptoblob::Key; +use uidindex::{UidIndex, UidIndexOp}; + +#[tokio::main] +async fn main() { + do_stuff().await.expect("Something failed"); +} + +async fn do_stuff() -> Result<()> { + let creds = EnvironmentProvider::default().credentials().await.unwrap(); + + let k2v_region = Region::Custom { + name: "garage-staging".to_owned(), + endpoint: "https://k2v-staging.home.adnab.me".to_owned(), + }; + + let s3_region = Region::Custom { + name: "garage-staging".to_owned(), + endpoint: "https://garage-staging.home.adnab.me".to_owned(), + }; + + let key = Key::from_slice(&[0u8; 32]).unwrap(); + + let mut mail_index = Bayou::<UidIndex>::new( + creds, + k2v_region, + s3_region, + "alex".into(), + "TestMailbox".into(), + key, + )?; + + mail_index.sync().await?; + + Ok(()) +} |