refactor: remove explict cert file path from backend mods and define abstracted trait for the cert source preparing librarization
This commit is contained in:
parent
6c0fd85ca5
commit
05b2aab8b0
8 changed files with 55 additions and 60 deletions
|
|
@ -1,12 +1,16 @@
|
|||
use super::toml::ConfigToml;
|
||||
use crate::{backend::Backends, certs::CryptoSource, error::*, globals::*, log::*, utils::BytesName};
|
||||
use crate::{
|
||||
backend::Backends,
|
||||
cert_file_reader::CryptoFileSource,
|
||||
error::{anyhow, ensure},
|
||||
globals::*,
|
||||
log::*,
|
||||
utils::BytesName,
|
||||
};
|
||||
use clap::Arg;
|
||||
use tokio::runtime::Handle;
|
||||
|
||||
pub fn build_globals<T>(runtime_handle: Handle) -> std::result::Result<Globals<T>, anyhow::Error>
|
||||
where
|
||||
T: CryptoSource + Clone,
|
||||
{
|
||||
pub fn build_globals(runtime_handle: Handle) -> std::result::Result<Globals<CryptoFileSource>, anyhow::Error> {
|
||||
let _ = include_str!("../../Cargo.toml");
|
||||
let options = clap::command!().arg(
|
||||
Arg::new("config_file")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue