mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
6276883f04
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.
20 lines
542 B
Go
20 lines
542 B
Go
package schema
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
// RegulationConfiguration represents the configuration related to regulation.
|
|
type RegulationConfiguration struct {
|
|
MaxRetries int `koanf:"max_retries"`
|
|
FindTime time.Duration `koanf:"find_time,weak"`
|
|
BanTime time.Duration `koanf:"ban_time,weak"`
|
|
}
|
|
|
|
// DefaultRegulationConfiguration represents default configuration parameters for the regulator.
|
|
var DefaultRegulationConfiguration = RegulationConfiguration{
|
|
MaxRetries: 3,
|
|
FindTime: time.Minute * 2,
|
|
BanTime: time.Minute * 5,
|
|
}
|