mirror of
https://codeberg.org/icewind/nextcloud-config-parser.git
synced 2026-06-03 08:34:13 +02:00
updates
This commit is contained in:
parent
a8f4622c1a
commit
bb16d30aa2
6 changed files with 410 additions and 469 deletions
|
|
@ -24,7 +24,7 @@ fn config_from_file(path: &str) -> Config {
|
|||
|
||||
fn parse_redis(cfg: &str) -> RedisConnectionInfo {
|
||||
let redis = ConnectionInfo::from_str(cfg).unwrap();
|
||||
let addr = match redis.addr {
|
||||
let addr = match redis.addr().clone() {
|
||||
ConnectionAddr::Tcp(host, port) => RedisConnectionAddr::Tcp {
|
||||
host,
|
||||
port,
|
||||
|
|
@ -36,12 +36,17 @@ fn parse_redis(cfg: &str) -> RedisConnectionInfo {
|
|||
tls: true,
|
||||
},
|
||||
ConnectionAddr::Unix(path) => RedisConnectionAddr::Unix { path },
|
||||
_ => RedisConnectionAddr::Tcp {
|
||||
host: "127.0.0.1".into(),
|
||||
port: 6379,
|
||||
tls: false,
|
||||
},
|
||||
};
|
||||
RedisConnectionInfo {
|
||||
addr,
|
||||
db: redis.redis.db,
|
||||
username: redis.redis.username,
|
||||
password: redis.redis.password,
|
||||
db: redis.redis_settings().db(),
|
||||
username: redis.redis_settings().username().map(String::from),
|
||||
password: redis.redis_settings().password().map(String::from),
|
||||
tls_params: None,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue