Documentation
¶
Overview ¶
Package configutil provides utilities for rule configuration resolution.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Coerce ¶
Coerce converts a dynamic rule config value to a typed config with defaults. Supported inputs:
- T
- *T
- map[string]any (decoded via Resolve)
Any unsupported value falls back to defaults.
func Resolve ¶
Resolve merges user options over defaults and unmarshals to typed config. If opts is nil or empty, returns defaults unchanged. This eliminates duplicated map-to-struct conversion in each rule.
Note: For slice/map fields, only nil values are replaced with defaults. An explicitly empty slice ([]string{}) preserves the empty value, allowing users to explicitly clear defaults.
func RuleSchema ¶ added in v0.12.0
RuleSchema returns the externalized JSON schema map for a rule.
func ValidateRuleOptions ¶ added in v0.12.0
ValidateRuleOptions validates rule-specific options using the schema registry.
Types ¶
This section is empty.