Documentation ¶
Index ¶
- type Formatter
- type MarkdownFormatter
- func (f *MarkdownFormatter) FormatErrorMessage(message string) string
- func (f *MarkdownFormatter) FormatMessage(message string) string
- func (f *MarkdownFormatter) FormatRule(rule *domain.Rule) string
- func (f *MarkdownFormatter) FormatServerMessage(message string) string
- func (f *MarkdownFormatter) FormatViolations(header string, violations []domain.Violation) string
- func (f *MarkdownFormatter) FormatViolationsCount(violationsCount *domain.ViolationsCount) string
- type PrettyColorizer
- type PrettyFormatter
- func (f *PrettyFormatter) FormatErrorMessage(message string) string
- func (f *PrettyFormatter) FormatMessage(message string) string
- func (f *PrettyFormatter) FormatRule(rule *domain.Rule) string
- func (f *PrettyFormatter) FormatServerMessage(message string) string
- func (f *PrettyFormatter) FormatViolations(header string, violations []domain.Violation) string
- func (f *PrettyFormatter) FormatViolationsCount(violationsCount *domain.ViolationsCount) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Formatter ¶
type Formatter interface { FormatViolations(header string, violations []domain.Violation) string FormatViolationsCount(violationsCount *domain.ViolationsCount) string FormatMessage(message string) string FormatServerMessage(message string) string FormatRule(rule *domain.Rule) string FormatErrorMessage(message string) string }
Formatter provides an interface for output formatters
func NewFormatter ¶
NewFormatter creates a formatter for a given format
type MarkdownFormatter ¶
type MarkdownFormatter struct { }
MarkdownFormatter is used to generate output in markdown format
func (*MarkdownFormatter) FormatErrorMessage ¶
func (f *MarkdownFormatter) FormatErrorMessage(message string) string
func (*MarkdownFormatter) FormatMessage ¶
func (f *MarkdownFormatter) FormatMessage(message string) string
FormatMessage formats message
func (*MarkdownFormatter) FormatRule ¶
func (f *MarkdownFormatter) FormatRule(rule *domain.Rule) string
FormatRule formats rule description
func (*MarkdownFormatter) FormatServerMessage ¶
func (f *MarkdownFormatter) FormatServerMessage(message string) string
FormatServerMessage formats server message
func (*MarkdownFormatter) FormatViolations ¶
func (f *MarkdownFormatter) FormatViolations(header string, violations []domain.Violation) string
FormatViolations formats the list of the violations
func (*MarkdownFormatter) FormatViolationsCount ¶
func (f *MarkdownFormatter) FormatViolationsCount(violationsCount *domain.ViolationsCount) string
FormatViolationsCount generates violation counters in in markdown format
type PrettyColorizer ¶
type PrettyColorizer struct {
// contains filtered or unexported fields
}
PrettyColorizer is used to generate ANSII colors for output
func NewPrettyColorizer ¶
func NewPrettyColorizer(useColors bool) *PrettyColorizer
NewPrettyColorizer creates an instance of PrettyColorizer
func (*PrettyColorizer) ColorizeByTypeFunc ¶
func (c *PrettyColorizer) ColorizeByTypeFunc(ruleType string) func(interface{}) aurora.Value
ColorizeByTypeFunc returns color function by a given type
type PrettyFormatter ¶
type PrettyFormatter struct {
// contains filtered or unexported fields
}
PrettyFormatter is used to generate violations in pretty format
func NewPrettyFormatter ¶
func NewPrettyFormatter(colorizer *PrettyColorizer) PrettyFormatter
NewPrettyFormatter creates a formatter for text output
func (*PrettyFormatter) FormatErrorMessage ¶
func (f *PrettyFormatter) FormatErrorMessage(message string) string
func (*PrettyFormatter) FormatMessage ¶
func (f *PrettyFormatter) FormatMessage(message string) string
FormatMessage formats message
func (*PrettyFormatter) FormatRule ¶
func (f *PrettyFormatter) FormatRule(rule *domain.Rule) string
FormatRule formats rule description
func (*PrettyFormatter) FormatServerMessage ¶
func (f *PrettyFormatter) FormatServerMessage(message string) string
FormatServerMessage formats server message
func (*PrettyFormatter) FormatViolations ¶
func (f *PrettyFormatter) FormatViolations(header string, violations []domain.Violation) string
FormatViolations formats the list of the violations
func (*PrettyFormatter) FormatViolationsCount ¶
func (f *PrettyFormatter) FormatViolationsCount(violationsCount *domain.ViolationsCount) string
FormatViolationsCount generates violation counters in in pretty format