AdguardTeam / AdguardTeam/AdGuardHome

Use a uniform duration format in the configuration file?

Abierto
#3,034 0 comentarios 2 reacciones 0 asignados Ver en GitHub
enhancement P4: Low
Lenguaje dominante
TypeScript
Estrellas
36.9k
Forks
2.5k
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.