AdguardTeam / AdguardTeam/AdGuardHome
Use a uniform duration format in the configuration file?
- Lingua principale
- TypeScript
- Stelle
- 36.9k
- Fork
- 2.5k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Currently, we either have the time unit in the name of the field, like with `block_auth_min` and `dhcp.dhcpv4.icmp_timeout_msec` or don't have a unit at all, like with `dns.querylog_interval` or `web_session_ttl`. But Go has the `time.Duration` type, which has a well-known string serialisation format. Unfortunately, it doesn't implement the `encoding.TextMarshaler` and `encoding.TextUnmarshaler` interfaces, but that is relatively easy to fix. In return, we get more uniform an human-readable durations in our configuration file:
```yaml
# …
web_session_ttl: 30d
# …
dns:
# …
querylog_interval: 90d
# …
dhcp:
dhcpv4:
# …
icmp_timeout: 1s
```
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.