AdguardTeam / AdguardTeam/AdGuardHome

Use a uniform duration format in the configuration file?

Open
#3,034 0 comments 2 reactions 0 assignees View on GitHub
enhancement P4: Low
Dominant language
TypeScript
Stars
36.9k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

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
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.