pub struct ArgConfig {
pub uuid: Uuid,
pub uuid_gen: bool,
pub db_url: String,
pub table: String,
pub cfg: HashMap<String, String>,
pub token: Token,
pub pk: Option<KeyFile>,
pub secret: Option<String>,
}
Expand description
App startup args:
-
db connection url: usually the first arg
- or prefix with: ’–db ’ (optional, default postgres:// )
-
config table name in format: schema.table, usually the second arg.
- or prefix with: ’–config ’ (optional, default public.{the_appname})
-
token (db pwd) script name usually the third arg (required feature ‘token’)
- or prefix with ’–token ’
-
token live in minutes, usually the forth arg (required feature ‘token’)
- or prefix with ’–ttl ’
-
UUID this app instance to use as a node id or config recognition. Identified as UUID formatted string.
- or prefix with ’–uuid ’
-
(Private) Key text file name to use with RSA OR AES encryption (required feature ‘rsa’)
- or prefix with ’–key ’
-
cipher secret for AES taken from env [SECRET] OR cml –secret compile with keep_env_secret feature to not remove from env
Alternative configuration:
- file name, usually the first arg
- or prefix with ’–file ’
File format:
- db: OR db=
- config: OR config=
- token: OR token=
- uuid: OR uuid=
- ttl: OR ttl=
- pk: OR pk=
params passed in cmd line override params loaded from file & env.
env: PGPASSWORD, in case of postgres db url, use to connect to the DB PASSPHRASE, in case of RSA private key required a passphrase
Fields§
§uuid: Uuid
instance ID
uuid_gen: bool
indicate the instance uuid was set or autogenerated on (every) start
db_url: String
database connection string
table: String
Format: schema.table
cfg: HashMap<String, String>
key=value loaded from file if present
token: Token
token (i.e. db pwd) script name usually the third arg (required feature ‘token’)
pk: Option<KeyFile>
RSA private key file name to use with RSA OR AES encryption (required feature ‘rsa’)
secret: Option<String>
cipher secret for AES taken from env [SECRET] OR cml –secret use keep_env_secret feature to not remove from env