Initial commit

This is definitely not functional yet.

Signed-off-by: Jacob Kiers <code@kiers.eu>
This commit is contained in:
2024-10-04 20:27:23 +02:00
commit f0b8df90b9
582 changed files with 43994 additions and 0 deletions

29
bank2ff/src/config.rs Normal file
View File

@@ -0,0 +1,29 @@
use serde::Deserialize;
#[derive(Deserialize, Debug)]
pub(super) struct AppConfiguration {
pub(crate) firefly_iii_url: String,
pub(crate) firefly_iii_api_key: String,
pub(crate) go_cardless_key: String,
pub(crate) go_cardless_id: String,
}
impl AppConfiguration {
pub(super) fn from_env() -> Result<Self, dotenv::Error> {
use dotenv::var;
let firefly_iii_url = var("FIREFLY_III_URL")?;
let firefly_iii_api_key = var("FIREFLY_III_API_KEY")?;
let go_cardless_key = var("GOCARDLESS_KEY")?;
let go_cardless_id = var("GOCARDLESS_ID")?;
Ok(Self {
firefly_iii_url,
firefly_iii_api_key,
go_cardless_key,
go_cardless_id,
})
}
}