1
0
mirror of https://github.com/pcvolkmer/mv64e-rest-to-kafka-gateway synced 2025-09-13 09:12:51 +00:00

refactor: cleanup env var names

This commit is contained in:
2025-08-27 09:16:28 +02:00
parent 2c813491e7
commit 6a28bce9a5
2 changed files with 42 additions and 44 deletions

View File

@@ -4,10 +4,24 @@ use clap::Parser;
#[command(author, version, about)]
#[command(arg_required_else_help(true))]
pub struct Cli {
#[arg(
long,
env = "LISTEN",
default_value = "[::]:3000",
help = "Address and port for HTTP requests"
)]
pub listen: String,
#[arg(
long,
alias = "security-token",
env = "SECURITY_TOKEN",
help = "bcrypt hashed Security Token"
)]
pub token: String,
#[arg(
long,
alias = "kafka-servers",
env = "APP_KAFKA_SERVERS",
env = "KAFKA_BOOTSTRAP_SERVERS",
default_value = "kafka:9094",
help = "Kafka Bootstrap Server"
)]
@@ -15,47 +29,29 @@ pub struct Cli {
#[arg(
long,
alias = "kafka-topic",
env = "APP_KAFKA_TOPIC",
env = "KAFKA_TOPIC",
default_value = "etl-processor_input",
help = "Kafka Topic"
)]
pub topic: String,
#[arg(
long,
alias = "security-token",
env = "APP_SECURITY_TOKEN",
help = "bcrypt hashed Security Token"
)]
pub token: String,
#[arg(
long,
env = "APP_LISTEN",
default_value = "[::]:3000",
help = "Address and port for HTTP requests"
)]
pub listen: String,
#[arg(
long,
env = "APP_KAFKA_SSL_CA_FILE",
env = "KAFKA_SSL_CA_FILE",
help = "CA file for SSL connection to Kafka"
)]
pub ssl_ca_file: Option<String>,
#[arg(
long,
env = "APP_KAFKA_SSL_CERT_FILE",
env = "KAFKA_SSL_CERT_FILE",
help = "Certificate file for SSL connection to Kafka"
)]
pub ssl_cert_file: Option<String>,
#[arg(
long,
env = "APP_KAFKA_SSL_KEY_FILE",
env = "KAFKA_SSL_KEY_FILE",
help = "Key file for SSL connection to Kafka"
)]
pub ssl_key_file: Option<String>,
#[arg(
long,
env = "APP_KAFKA_SSL_KEY_PASSWORD",
help = "The SSL key password"
)]
#[arg(long, env = "KAFKA_SSL_KEY_PASSWORD", help = "The SSL key password")]
pub ssl_key_password: Option<String>,
}