-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(repo): use cli instead of config.toml
- Loading branch information
1 parent
71119fa
commit 95f388c
Showing
6 changed files
with
102 additions
and
191 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,64 @@ | ||
use clap::Parser; | ||
|
||
/// CLI structure for parsing command-line arguments. | ||
/// | ||
/// - `config_path`: Path to the toml config file. | ||
#[derive(Clone, Parser)] | ||
pub struct Cli { | ||
/// Config path | ||
/// API port number | ||
#[arg( | ||
long, | ||
value_name = "CONFIG", | ||
env = "CONFIG_PATH", | ||
default_value = "config.toml", | ||
help = "Path to toml config file" | ||
value_name = "PORT", | ||
env = "API_PORT", | ||
default_value = "9003", | ||
help = "Port number for the API server" | ||
)] | ||
pub config_path: Option<String>, | ||
pub api_port: u16, | ||
|
||
/// NATS URL | ||
#[arg( | ||
long, | ||
value_name = "NATS_URL", | ||
env = "NATS_URL", | ||
default_value = "nats://localhost:4222", | ||
help = "NATS URL" | ||
)] | ||
pub nats_url: String, | ||
|
||
/// Fuel network configuration | ||
#[arg( | ||
long, | ||
value_name = "NETWORK", | ||
env = "NETWORK", | ||
default_value = "local", | ||
help = "Fuel network configuration (local, etc.)" | ||
)] | ||
pub network: String, | ||
|
||
/// Enable S3 | ||
#[arg( | ||
long, | ||
value_name = "AWS_S3_ENABLED", | ||
env = "AWS_S3_ENABLED", | ||
default_value = "true", | ||
help = "Enable S3 integration" | ||
)] | ||
pub s3_enabled: bool, | ||
|
||
/// JWT secret | ||
#[arg( | ||
long, | ||
value_name = "JWT_AUTH_SECRET", | ||
env = "JWT_AUTH_SECRET", | ||
default_value = "secret", | ||
help = "Secret key for JWT authentication" | ||
)] | ||
pub jwt_secret: String, | ||
|
||
/// Use metrics | ||
#[arg( | ||
long, | ||
env = "USE_METRICS", | ||
default_value = "false", | ||
help = "Enable metrics" | ||
)] | ||
pub use_metrics: bool, | ||
} |
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
Oops, something went wrong.