aboutsummaryrefslogtreecommitdiff
path: root/aerogramme/src
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2024-03-08 10:20:45 +0100
committerQuentin Dufour <quentin@deuxfleurs.fr>2024-03-08 10:20:45 +0100
commitb9f32d720ae5ec60cadeb492af781ade48cd6cbf (patch)
tree5b4d01700bddc66c77809ef2cc3183f88ccaf229 /aerogramme/src
parent11462f80c4ae25696c7436ed7aacb92074d7e911 (diff)
downloadaerogramme-b9f32d720ae5ec60cadeb492af781ade48cd6cbf.tar.gz
aerogramme-b9f32d720ae5ec60cadeb492af781ade48cd6cbf.zip
Finalize Aerogramme's refactor
Diffstat (limited to 'aerogramme/src')
-rw-r--r--aerogramme/src/k2v_util.rs26
-rw-r--r--aerogramme/src/lib.rs19
-rw-r--r--aerogramme/src/main.rs10
-rw-r--r--aerogramme/src/server.rs14
4 files changed, 13 insertions, 56 deletions
diff --git a/aerogramme/src/k2v_util.rs b/aerogramme/src/k2v_util.rs
deleted file mode 100644
index 3cd969b..0000000
--- a/aerogramme/src/k2v_util.rs
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
-use anyhow::Result;
-// ---- UTIL: function to wait for a value to have changed in K2V ----
-
-pub async fn k2v_wait_value_changed(
- k2v: &storage::RowStore,
- key: &storage::RowRef,
-) -> Result<CausalValue> {
- loop {
- if let Some(ct) = prev_ct {
- match k2v.poll_item(pk, sk, ct.clone(), None).await? {
- None => continue,
- Some(cv) => return Ok(cv),
- }
- } else {
- match k2v.read_item(pk, sk).await {
- Err(k2v_client::Error::NotFound) => {
- k2v.insert_item(pk, sk, vec![0u8], None).await?;
- }
- Err(e) => return Err(e.into()),
- Ok(cv) => return Ok(cv),
- }
- }
- }
-}
-*/
diff --git a/aerogramme/src/lib.rs b/aerogramme/src/lib.rs
deleted file mode 100644
index f065478..0000000
--- a/aerogramme/src/lib.rs
+++ /dev/null
@@ -1,19 +0,0 @@
-#![feature(type_alias_impl_trait)]
-#![feature(async_fn_in_trait)]
-#![feature(async_closure)]
-#![feature(trait_alias)]
-
-pub mod auth;
-pub mod bayou;
-pub mod config;
-pub mod cryptoblob;
-pub mod dav;
-pub mod imap;
-pub mod k2v_util;
-pub mod lmtp;
-pub mod login;
-pub mod mail;
-pub mod server;
-pub mod storage;
-pub mod timestamp;
-pub mod user;
diff --git a/aerogramme/src/main.rs b/aerogramme/src/main.rs
index 43b4dca..4251520 100644
--- a/aerogramme/src/main.rs
+++ b/aerogramme/src/main.rs
@@ -1,3 +1,5 @@
+mod server;
+
use std::io::Read;
use std::path::PathBuf;
@@ -5,9 +7,9 @@ use anyhow::{bail, Context, Result};
use clap::{Parser, Subcommand};
use nix::{sys::signal, unistd::Pid};
-use aerogramme::config::*;
-use aerogramme::login::{static_provider::*, *};
-use aerogramme::server::Server;
+use aero_user::config::*;
+use aero_user::login::{static_provider::*, *};
+use crate::server::Server;
#[derive(Parser, Debug)]
#[clap(author, version, about, long_about = None)]
@@ -151,7 +153,7 @@ fn tracer() {
#[tokio::main]
async fn main() -> Result<()> {
if std::env::var("RUST_LOG").is_err() {
- std::env::set_var("RUST_LOG", "main=info,aerogramme=info,k2v_client=info")
+ std::env::set_var("RUST_LOG", "info")
}
// Abort on panic (same behavior as in Go)
diff --git a/aerogramme/src/server.rs b/aerogramme/src/server.rs
index 09e91ad..e302db3 100644
--- a/aerogramme/src/server.rs
+++ b/aerogramme/src/server.rs
@@ -7,13 +7,13 @@ use futures::try_join;
use log::*;
use tokio::sync::watch;
-use crate::auth;
-use crate::config::*;
-use crate::dav;
-use crate::imap;
-use crate::lmtp::*;
-use crate::login::ArcLoginProvider;
-use crate::login::{demo_provider::*, ldap_provider::*, static_provider::*};
+use aero_user::config::*;
+use aero_user::login::ArcLoginProvider;
+use aero_user::login::{demo_provider::*, ldap_provider::*, static_provider::*};
+use aero_proto::sasl as auth;
+use aero_proto::dav;
+use aero_proto::imap;
+use aero_proto::lmtp::*;
pub struct Server {
lmtp_server: Option<Arc<LmtpServer>>,