content

package
v0.0.0-...-a7cb739 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	Path string `mapstructure:"path" toml:"path"`
}

Configuration represents configuration for content configuration file

type ErrorKeyMetadata

type ErrorKeyMetadata struct {
	Description string   `yaml:"description" json:"description"`
	Impact      string   `yaml:"impact" json:"impact"`
	Likelihood  int      `yaml:"likelihood" json:"likelihood"`
	PublishDate string   `yaml:"publish_date" json:"publish_date"`
	Status      string   `yaml:"status" json:"status"`
	Tags        []string `yaml:"tags" json:"tags"`
}

ErrorKeyMetadata is a Go representation of the `metadata.yaml` file inside of an error key content directory.

type RuleContent

type RuleContent struct {
	Plugin     RulePluginInfo                 `json:"plugin"`
	ErrorKeys  map[string]RuleErrorKeyContent `json:"error_keys"`
	Generic    string                         `json:"generic"`
	Summary    string                         `json:"summary"`
	Resolution string                         `json:"resolution"`
	MoreInfo   string                         `json:"more_info"`
	Reason     string                         `json:"reason"`
	HasReason  bool
}

RuleContent wraps all the content available for a rule into a single structure.

func ParseContent

func ParseContent(filePath string) ([]RuleContent, error)

ParseContent function parses JSON file with rules contents.

type RuleErrorKeyContent

type RuleErrorKeyContent struct {
	Metadata   ErrorKeyMetadata `json:"metadata"`
	TotalRisk  int              `json:"total_risk"`
	Generic    string           `json:"generic"`
	Summary    string           `json:"summary"`
	Resolution string           `json:"resolution"`
	MoreInfo   string           `json:"more_info"`
	Reason     string           `json:"reason"`
	// DONTFIX has_reason until CCXDEV-5021
	HasReason bool
}

RuleErrorKeyContent wraps content of a single error key.

type RulePluginInfo

type RulePluginInfo struct {
	Name         string `yaml:"name" json:"name"`
	NodeID       string `yaml:"node_id" json:"node_id"`
	ProductCode  string `yaml:"product_code" json:"product_code"`
	PythonModule string `yaml:"python_module" json:"python_module"`
}

RulePluginInfo is a Go representation of the `plugin.yaml` file inside of the rule content directory.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL