mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-11 01:36:37 +08:00
feat(config): add openresty default rate limit system options
This commit is contained in:
@@ -73,6 +73,14 @@ func validatePositiveIntegerOption(key, value string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func validateNonNegativeIntegerOption(key, value string) error {
|
||||
intValue, err := strconv.Atoi(value)
|
||||
if err != nil || intValue < 0 {
|
||||
return fmt.Errorf("%s 必须为大于等于 0 的整数", key)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func validateBooleanOption(key, value string) error {
|
||||
switch value {
|
||||
case optionValueTrue, "false":
|
||||
|
||||
Reference in New Issue
Block a user