Documentation
¶
Overview ¶
Package content contains logic for parsing rule content.
Package content contains logic for parsing rule content.
Index ¶
Constants ¶
const ( // PluginYAML represents the filename of rule's plugin specification PluginYAML = "plugin.yaml" // MetadataYAML represents the filename of rule error key's metadata MetadataYAML = "metadata.yaml" // GenericMarkdown contains a generic message that should briefly describe the recommendation GenericMarkdown = "generic.md" // SummaryMarkdown contains more descriptive information about the recommendation SummaryMarkdown = "summary.md" // ReasonMarkdown contains the reason why this recommendation was triggered ReasonMarkdown = "reason.md" // ResolutionMarkdown contains resolution steps to the given recommendation/issue ResolutionMarkdown = "resolution.md" // MoreInfoMarkdown contains additional information that further describe the recommendation MoreInfoMarkdown = "more_info.md" // InternalRulesGroup is a name for a group with all internal rules InternalRulesGroup = "internal" // ExternalRulesGroup is a name for a group with all external rules ExternalRulesGroup = "external" // OcsRulesGroup is a name for a group with all ocs rules OcsRulesGroup = "ocs" )
Logging messages
Variables ¶
var ( // MandatoryRuleWideContentFiles are mandatory files that MUST be on rule plugin or error key level MandatoryRuleWideContentFiles = []string{GenericMarkdown, ReasonMarkdown} SharedContentFiles = []string{GenericMarkdown, ReasonMarkdown, SummaryMarkdown, ResolutionMarkdown, MoreInfoMarkdown} // RulePluginMandatoryContentFiles are mandatory on the plugin level RulePluginMandatoryContentFiles = []string{PluginYAML} // RulePluginContentFiles are all files to look for on rule plugin level RulePluginContentFiles = append(SharedContentFiles, RulePluginMandatoryContentFiles...) // ErrorKeyMandatoryContentFiles are mandatory on the error key level ErrorKeyMandatoryContentFiles = []string{MetadataYAML} // ErrorKeyContentFiles are all files to look for on error key level ErrorKeyContentFiles = append(SharedContentFiles, ErrorKeyMandatoryContentFiles...) // GlobalConfig represents configrations globally applicable to any/all rule GlobalConfig GlobalRuleConfig )
Functions ¶
This section is empty.
Types ¶
type ErrorKeyMetadata ¶
type ErrorKeyMetadata = ctypes.ErrorKeyMetadata
ErrorKeyMetadata is a Go representation of the `metadata.yaml` file inside of an error key content directory.
type GlobalRuleConfig ¶
type GlobalRuleConfig = ctypes.GlobalRuleConfig
GlobalRuleConfig represents the file that contains metadata globally applicable to any/all rule content.
type InvalidItem ¶
InvalidItem is an error raised when unexpected type is found when parsing
func (InvalidItem) Error ¶
func (err InvalidItem) Error() string
type MissingMandatoryFile ¶
type MissingMandatoryFile struct {
FileName string
}
MissingMandatoryFile is an error raised while parsing, when a mandatory file is missing
func (MissingMandatoryFile) Error ¶
func (err MissingMandatoryFile) Error() string
type RuleContent ¶
type RuleContent = ctypes.RuleContent
RuleContent wraps all the content available for a rule into a single structure.
type RuleContentDirectory ¶
type RuleContentDirectory = ctypes.RuleContentDirectory
RuleContentDirectory contains content for all available rules in a directory.
func ParseRuleContentDir ¶
func ParseRuleContentDir(contentDirPath string) (RuleContentDirectory, map[string]ctypes.RuleContentStatus, error)
ParseRuleContentDir finds all rule content in a directory and parses it.
type RuleErrorKeyContent ¶
type RuleErrorKeyContent = ctypes.RuleErrorKeyContent
RuleErrorKeyContent wraps content of a single error key.
type RulePluginInfo ¶
type RulePluginInfo = ctypes.RulePluginInfo
RulePluginInfo is a Go representation of the `plugin.yaml` file inside of the rule content directory.