diff options
| author | James Elliott <james-d-elliott@users.noreply.github.com> | 2022-03-02 17:40:26 +1100 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-02 17:40:26 +1100 | 
| commit | 6276883f04c25af02339432bef4349f3904f19b2 (patch) | |
| tree | f6b8d5dac325fbfe35d201dd0bdc8660bb0c13fb /internal/configuration/provider.go | |
| parent | d867fa1a63c53245525c21f7ce371dffbcbebf5e (diff) | |
refactor(configuration): utilize time duration decode hook (#2938)
This enhances the existing time.Duration parser to allow multiple units, and implements a decode hook which can be used by koanf to decode string/integers into time.Durations as applicable.
Diffstat (limited to 'internal/configuration/provider.go')
| -rw-r--r-- | internal/configuration/provider.go | 2 | 
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/configuration/provider.go b/internal/configuration/provider.go index ba7243ee0..70f8baf38 100644 --- a/internal/configuration/provider.go +++ b/internal/configuration/provider.go @@ -43,9 +43,9 @@ func unmarshal(ko *koanf.Koanf, val *schema.StructValidator, path string, o inte  	c := koanf.UnmarshalConf{  		DecoderConfig: &mapstructure.DecoderConfig{  			DecodeHook: mapstructure.ComposeDecodeHookFunc( -				mapstructure.StringToTimeDurationHookFunc(),  				mapstructure.StringToSliceHookFunc(","),  				StringToMailAddressFunc(), +				ToTimeDurationFunc(),  			),  			Metadata:         nil,  			Result:           o,  | 
