Files
banks2ff/bank2ff/src/config.rs
Jacob Kiers f0b8df90b9 Initial commit
This is definitely not functional yet.

Signed-off-by: Jacob Kiers <code@kiers.eu>
2024-10-04 20:31:39 +02:00

30 lines
782 B
Rust

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,
})
}
}