Move to yaml-based configuration
This commit updates the configuration to be yaml-based and updates the configuration to read in a yaml file.
This commit is contained in:
parent
568c005d15
commit
945329a080
70 changed files with 1150 additions and 350 deletions
14
internal/config/validators/duration.go
Normal file
14
internal/config/validators/duration.go
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
package validators
|
||||
|
||||
import "time"
|
||||
|
||||
func ValidateDuration(d *time.Duration, dflt string) error {
|
||||
if *d == 0 {
|
||||
var err error
|
||||
*d, err = time.ParseDuration(dflt)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue