formatters

package
v0.0.0-...-bd26d79 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: MIT Imports: 7 Imported by: 2

Documentation

Overview

Package formatters provides the base interface type for different output formatters to implement

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomFormatter

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

CustomFormatter is a formatter that is configurable via a template string

func NewCustomFormatter

func NewCustomFormatter(templateString string) (ret *CustomFormatter, err error)

NewCustomFormatter returns a CustomFormatter struct

func (*CustomFormatter) Format

func (f *CustomFormatter) Format(violations rules.RuleViolationList)

Format is the function to call to get the formatted output

type DefaultFormatter

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

DefaultFormatter is the formatter used by default for CLI output

func NewDefaultFormatter

func NewDefaultFormatter() *DefaultFormatter

NewDefaultFormatter returns a DefaultFormatter struct

func (*DefaultFormatter) Format

func (f *DefaultFormatter) Format(violations rules.RuleViolationList)

Format is the function to call to get the formatted output

type Formatter

type Formatter interface {
	Format(violations rules.RuleViolationList)
}

Formatter is the base interface type to implement for formatters

Jump to

Keyboard shortcuts

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