printer

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 31, 2022 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EvaluationSummary

type EvaluationSummary struct {
	ConfigsCount              int
	RulesCount                int
	FilesCount                int
	PassedYamlValidationCount int
	K8sValidation             string
	PassedPolicyCheckCount    int
}

type ExtraMessage

type ExtraMessage struct {
	Text  string
	Color string
}

type FailedRule

type FailedRule struct {
	Name               string
	Occurrences        int
	Suggestion         string
	DocumentationUrl   string
	OccurrencesDetails []OccurrenceDetails
}

type InvalidK8sInfo

type InvalidK8sInfo struct {
	ValidationErrors  []error
	ValidationWarning string
	K8sVersion        string
}

type InvalidYamlInfo

type InvalidYamlInfo struct {
	ValidationErrors []error
}

type JSONSchemaValidatorResults

type JSONSchemaValidatorResults = gojsonschema.Result

type OccurrenceDetails

type OccurrenceDetails struct {
	MetadataName string
	Kind         string
	SkipMessage  string
}

type Printer

type Printer struct {
	Theme *Theme
}

func CreateNewPrinter

func CreateNewPrinter() *Printer

func (*Printer) PrintEvaluationSummary

func (p *Printer) PrintEvaluationSummary(summary EvaluationSummary, k8sVersion string)

func (*Printer) PrintFilename

func (p *Printer) PrintFilename(title string)

func (*Printer) PrintMessage

func (p *Printer) PrintMessage(messageText string, messageColor string)

func (*Printer) PrintPromptMessage

func (p *Printer) PrintPromptMessage(promptMessage string)

func (*Printer) PrintSummaryTable

func (p *Printer) PrintSummaryTable(summary Summary)

func (*Printer) PrintWarnings

func (p *Printer) PrintWarnings(warnings []Warning)

func (*Printer) PrintYamlSchemaResults

func (p *Printer) PrintYamlSchemaResults(errorsResult []jsonschema.Detailed, error error)

func (*Printer) PrintYamlValidationErrors

func (p *Printer) PrintYamlValidationErrors(yamlValidationErrors []error)

func (*Printer) PrintYamlValidationSummary

func (p *Printer) PrintYamlValidationSummary(passedFiles int, allFiles int)

func (*Printer) SetTheme

func (p *Printer) SetTheme(theme *Theme)

type Summary

type Summary struct {
	PlainRows  []SummaryItem
	SkipRow    SummaryItem
	ErrorRow   SummaryItem
	SuccessRow SummaryItem
}

type SummaryItem

type SummaryItem struct {
	RightCol string
	LeftCol  string
	RowIndex int
}

type Theme

type Theme struct {
	Colors struct {
		Green     *color.Color
		Yellow    *color.Color
		RedBold   *color.Color
		White     *color.Color
		WhiteBold *color.Color
		Error     *color.Color
		Cyan      *color.Color
		CyanBold  *color.Color
	}
	ColorsAttributes struct {
		Cyan  color.Attribute
		Green color.Attribute
		Red   color.Attribute
	}
	Spacing struct {
		Default string
	}
	Emoji struct {
		Error      string
		Suggestion string
		Skip       string
	}
}

func CreateSimpleTheme

func CreateSimpleTheme() *Theme

type Warning

type Warning struct {
	Title           string
	FailedRules     []FailedRule
	SkippedRules    []FailedRule
	InvalidYamlInfo InvalidYamlInfo
	InvalidK8sInfo  InvalidK8sInfo
	ExtraMessages   []ExtraMessage
}

Jump to

Keyboard shortcuts

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