aboutsummaryrefslogtreecommitdiff
path: root/src/server.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-05-19 15:14:36 +0200
committerAlex Auvolat <alex@adnab.me>2022-05-19 15:14:36 +0200
commit1dcb11643c783096e1b52bf48d6b76121504e6bd (patch)
tree658f1db34d0e4f91331dabcab85a5898a95d4ad4 /src/server.rs
parent6be90936a108d971e0cfa3ddaa9c2d54557e30f3 (diff)
downloadaerogramme-1dcb11643c783096e1b52bf48d6b76121504e6bd.tar.gz
aerogramme-1dcb11643c783096e1b52bf48d6b76121504e6bd.zip
CLI skeleton
Diffstat (limited to 'src/server.rs')
-rw-r--r--src/server.rs14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/server.rs b/src/server.rs
index 4c628d6..e1ab599 100644
--- a/src/server.rs
+++ b/src/server.rs
@@ -14,11 +14,11 @@ pub struct Server {
impl Server {
pub fn new(config: Config) -> Result<Arc<Self>> {
let s3_region = Region::Custom {
- name: config.s3_region,
+ name: config.aws_region.clone(),
endpoint: config.s3_endpoint,
};
let k2v_region = Region::Custom {
- name: config.k2v_region,
+ name: config.aws_region,
endpoint: config.k2v_endpoint,
};
let login_provider: Box<dyn LoginProvider> = match (config.login_static, config.login_ldap)
@@ -28,19 +28,13 @@ impl Server {
(Some(_), Some(_)) => bail!("A single login provider must be set up in config file"),
(None, None) => bail!("No login provider is set up in config file"),
};
- Ok(Arc::new(Self {
- login_provider,
- }))
+ Ok(Arc::new(Self { login_provider }))
}
pub async fn run(self: &Arc<Self>) -> Result<()> {
let creds = self.login_provider.login("lx", "plop").await?;
- let mut mailbox = Mailbox::new(
- &creds,
- "TestMailbox".to_string(),
- )
- .await?;
+ let mut mailbox = Mailbox::new(&creds, "TestMailbox".to_string()).await?;
mailbox.test().await?;