toInt converts a viper numeric value (int, int64, float64) to int.
(v any)
| 335 | |
| 336 | // toInt converts a viper numeric value (int, int64, float64) to int. |
| 337 | func toInt(v any) int { |
| 338 | switch n := v.(type) { |
| 339 | case int: |
| 340 | return n |
| 341 | case int64: |
| 342 | return int(n) |
| 343 | case float64: |
| 344 | return int(n) |
| 345 | default: |
| 346 | return 0 |
| 347 | } |
| 348 | } |
| 349 | |
| 350 | // parseScopeEntries converts raw viper scope data into typed ScopeConfig entries. |
| 351 | func parseScopeEntries(scopeMap map[string]any) map[string]validator.ScopeConfig { |