Start to implement energy consumption backend
This commit is contained in:
@ -1,6 +1,24 @@
|
||||
use clap::Parser;
|
||||
use clap::{Parser, Subcommand};
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
/// Electrical consumption fetcher backend
|
||||
#[derive(Subcommand, Debug, Clone)]
|
||||
pub enum ConsumptionBackend {
|
||||
/// Constant consumption value
|
||||
Constant {
|
||||
#[clap(long, default_value_t = 500)]
|
||||
value: i32,
|
||||
},
|
||||
|
||||
/// Generate random consumption value
|
||||
Random {
|
||||
#[clap(long, default_value_t = -5000)]
|
||||
min: i32,
|
||||
#[clap(long, default_value_t = 20000)]
|
||||
max: i32,
|
||||
},
|
||||
}
|
||||
|
||||
/// Solar system central backend
|
||||
#[derive(Parser, Debug)]
|
||||
#[command(version, about, long_about = None)]
|
||||
@ -20,6 +38,10 @@ pub struct AppConfig {
|
||||
/// Server storage path
|
||||
#[arg(short, long, env, default_value = "storage")]
|
||||
storage: String,
|
||||
|
||||
/// Consumption backend provider
|
||||
#[clap(subcommand)]
|
||||
pub consumption_backend: Option<ConsumptionBackend>,
|
||||
}
|
||||
|
||||
lazy_static::lazy_static! {
|
||||
|
Reference in New Issue
Block a user