mirror of
https://gitlab.com/fabinfra/fabaccess/bffh.git
synced 2024-11-22 06:47:56 +01:00
Finally switch over to Config instead of Settings
This commit is contained in:
parent
26f1de1907
commit
4c7359531d
@ -15,9 +15,6 @@ pub fn read(path: &Path) -> Result<Config> {
|
||||
.map_err(Into::into)
|
||||
}
|
||||
|
||||
#[deprecated]
|
||||
pub type Settings = Config;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Config {
|
||||
/// A list of address/port pairs to listen on.
|
||||
|
@ -8,7 +8,7 @@ use flexbuffers;
|
||||
use slog::Logger;
|
||||
use lmdb::{Environment, Transaction, RwTransaction, Cursor};
|
||||
|
||||
use crate::config::Settings;
|
||||
use crate::config::Config;
|
||||
use crate::error::Result;
|
||||
|
||||
use crate::db::access::{Permission, Role, RoleIdentifier, RoleDB};
|
||||
@ -163,7 +163,7 @@ impl RoleDB for Internal {
|
||||
|
||||
|
||||
/// Initialize the access db by loading all the lmdb databases
|
||||
pub fn init(log: Logger, config: &Settings, env: Arc<lmdb::Environment>)
|
||||
pub fn init(log: Logger, config: &Config, env: Arc<lmdb::Environment>)
|
||||
-> std::result::Result<Internal, crate::error::Error>
|
||||
{
|
||||
let mut flags = lmdb::DatabaseFlags::empty();
|
||||
|
@ -5,7 +5,7 @@ use serde::{Serialize, Deserialize};
|
||||
use std::sync::Arc;
|
||||
|
||||
use crate::error::Result;
|
||||
use crate::config::Settings;
|
||||
use crate::config::Config;
|
||||
|
||||
use uuid::Uuid;
|
||||
|
||||
@ -68,7 +68,7 @@ impl MachineState {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn init(log: Logger, config: &Settings, env: Arc<lmdb::Environment>) -> Result<Internal> {
|
||||
pub fn init(log: Logger, config: &Config, env: Arc<lmdb::Environment>) -> Result<Internal> {
|
||||
let mut flags = lmdb::DatabaseFlags::empty();
|
||||
flags.set(lmdb::DatabaseFlags::INTEGER_KEY, true);
|
||||
let machdb = env.create_db(Some("machines"), flags)?;
|
||||
|
@ -1,7 +1,7 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use slog::Logger;
|
||||
use lmdb::{Environment, Cursor, Transaction, RwTransaction};
|
||||
use lmdb::{Environment, Transaction, RwTransaction};
|
||||
|
||||
use crate::error::Result;
|
||||
|
||||
|
@ -245,7 +245,7 @@ impl MachineDescription {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn load(config: &crate::config::Settings, access: Arc<access::AccessControl>)
|
||||
pub fn load(config: &crate::config::Config, access: Arc<access::AccessControl>)
|
||||
-> Result<MachineMap>
|
||||
{
|
||||
let mut map = config.machines.clone();
|
||||
|
@ -1,7 +1,7 @@
|
||||
use slog::Logger;
|
||||
|
||||
use crate::config;
|
||||
use crate::config::Settings;
|
||||
use crate::config::Config;
|
||||
use crate::error::Error;
|
||||
use crate::connection;
|
||||
|
||||
@ -19,7 +19,7 @@ use crate::db::Databases;
|
||||
use crate::network::Network;
|
||||
|
||||
/// Handle all API connections and run the RPC tasks spawned from that on the local thread.
|
||||
pub fn serve_api_connections(log: Arc<Logger>, config: Settings, db: Databases, nw: Network)
|
||||
pub fn serve_api_connections(log: Arc<Logger>, config: Config, db: Databases, nw: Network)
|
||||
-> Result<(), Error>
|
||||
{
|
||||
let signal = Box::pin(async {
|
||||
|
Loading…
Reference in New Issue
Block a user