feat(config): add openresty default rate limit system options

This commit is contained in:
ryan
2026-07-19 18:12:51 +08:00
parent a3125c8276
commit 2bc2d82ad0
7 changed files with 78 additions and 0 deletions
@@ -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":