-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Use Chariott * Use Chariott * Use Chariott * Use Chariott * Use Chariott * Use Chariott * Use Chariott * Use Chariott * Use Chariott * Use Chariott * Use Chariott * Use Chariott * Use Chariott * Use Chariott * Use Chariott * Use Chariott * Use Chariott * Use Chariott * Use Chariott * Use Chariott * Use Chariott * Use Chariott * Use Chariott
- Loading branch information
Showing
34 changed files
with
1,086 additions
and
391 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
core/invehicle-digital-twin/src/invehicle_digital_twin_config.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
// SPDX-License-Identifier: MIT | ||
|
||
#![cfg(feature = "yaml")] | ||
|
||
use config::{Config, File, FileFormat}; | ||
use serde_derive::Deserialize; | ||
|
||
const CONFIG_FILENAME: &str = "invehicle_digital_twin_settings"; | ||
|
||
#[derive(Debug, Deserialize)] | ||
pub struct Settings { | ||
pub invehicle_digital_twin_authority: String, | ||
pub chariott_url: Option<String>, | ||
} | ||
|
||
/// Load the settings. | ||
pub fn load_settings() -> Settings { | ||
let config = | ||
Config::builder().add_source(File::new(CONFIG_FILENAME, FileFormat::Yaml)).build().unwrap(); | ||
|
||
let settings: Settings = config.try_deserialize().unwrap(); | ||
|
||
settings | ||
} |
Oops, something went wrong.