reporter

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToPolicyReport

func ConvertToPolicyReport(policy typepolicy.Policy) typepolr.PolicyReport

Types

type GenerationType

type GenerationType string
const (
	GenerationTypeRaw          GenerationType = "raw"
	GenerationTypePolicyReport GenerationType = "policy-report"
)

type Markdown

type Markdown struct{}

func NewMarkdown

func NewMarkdown() Markdown

func (*Markdown) Generate

func (m *Markdown) Generate(templateFile string, report typereport.ComplianceReport) ([]byte, error)

type PolicyResult

type PolicyResult string

- pass: the policy requirements are met - fail: the policy requirements are not met - warn: the policy requirements are not met and the policy is not scored - error: the policy could not be evaluated - skip: the policy was not selected based on user inputs or applicability

const (
	// the policy requirements are met
	PolicyResultPass PolicyResult = "pass"

	// the policy requirements are not met
	PolicyResultFail PolicyResult = "fail"

	// the policy requirements are not met and the policy is not scored
	PolicyResultWarn PolicyResult = "warn"

	// the policy could not be evaluated
	PolicyResultError PolicyResult = "error"

	// the policy was not selected based on user inputs or applicability
	PolicyResultSkip PolicyResult = "skip"
)

type Reason

type Reason struct {
	ClusterName     string                         `json:"clusterName,omitempty" yaml:"clusterName,omitempty"`
	ComplianceState typepolicy.ComplianceState     `json:"complianceState,omitempty" yaml:"complianceState,omitempty"`
	Messages        []typepolicy.ComplianceHistory `json:"messages,omitempty" yaml:"messages,omitempty"`
}

type Reporter

type Reporter struct {
	// contains filtered or unexported fields
}

func NewReporter

func NewReporter(c2pParsed typec2pcr.C2PCRParsed) *Reporter

func (*Reporter) Generate

func (r *Reporter) Generate() (typereport.ComplianceReport, error)

func (*Reporter) GenerateReasonsFromPolicyReports

func (r *Reporter) GenerateReasonsFromPolicyReports(policy typepolicy.Policy) []Reason

func (*Reporter) GenerateReasonsFromRawPolicies

func (r *Reporter) GenerateReasonsFromRawPolicies(policy typepolicy.Policy) []Reason

func (*Reporter) GetPolicyReports

func (r *Reporter) GetPolicyReports() []*typepolr.PolicyReport

func (*Reporter) SetGenerationType

func (r *Reporter) SetGenerationType(generationType GenerationType)

Jump to

Keyboard shortcuts

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