-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #75 from Icinga/config-docs
Document `config`
- Loading branch information
Showing
3 changed files
with
139 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,17 @@ | ||
package config | ||
|
||
// Validator is an interface that must be implemented by any configuration struct used in [FromYAMLFile]. | ||
// | ||
// The Validate method checks the configuration values and | ||
// returns an error if any value is invalid or missing when required. | ||
// | ||
// For fields such as file paths, the responsibility of Validate is limited to | ||
// verifying the presence and format of the value, | ||
// not checking external conditions like file existence or readability. | ||
// This principle applies generally to any field where external validation | ||
// (e.g., network availability, resource accessibility) is beyond the scope of basic configuration validation. | ||
type Validator interface { | ||
// Validate checks the configuration values and | ||
// returns an error if any value is invalid or missing when required. | ||
Validate() error | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters