dto

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: Unlicense Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromJSONString

func FromJSONString(obj interface{}, r io.Reader) error

func JSONFormat

func JSONFormat(output OutputDTO) (string, error)

func MarkdownFormat

func MarkdownFormat(output OutputDTO) (string, error)

func TabFormat

func TabFormat(output OutputDTO) (string, error)

func ToJSON

func ToJSON(obj interface{}, w io.Writer) error

Types

type Color

type Color string
const (
	ColorRed    Color = "\033[31m"
	ColorGreen  Color = "\033[32m"
	ColorYellow Color = "\033[33m"
	ColorBlue   Color = "\033[34m"
	ColorPurple Color = "\033[35m"
	ColorCyan   Color = "\033[36m"
	ColorWhite  Color = "\033[37m"
)

ASCII escape codes for colors, see: https://en.wikipedia.org/wiki/ANSI_escape_code#Colors

type CoverageConfig

type CoverageConfig struct {
	Global   *Threshold `json:"global,omitempty"`
	Matcher  *Matcher   `json:"matcher,omitempty"`
	Excludes []string   `json:"excludes"`
}

type CoverageOutputDTO

type CoverageOutputDTO struct {
	Stmts     string `json:"stmts"`
	Lines     string `json:"lines"`
	Branches  string `json:"branches"`
	Uncovered []int  `json:"uncovered,omitempty"`
}

type DirectoriesOutputDTO

type DirectoriesOutputDTO map[string]DirectoryOutputDTO

type DirectoryOutputDTO

type DirectoryOutputDTO struct {
	Coverage CoverageOutputDTO `json:"coverage"`
	Files    FilesOutputDTO    `json:"files,omitempty"`
}

type ErrorOutputDTO

type ErrorOutputDTO struct {
	AffectedFile      string `json:"affectedFile"`
	Type              string `json:"type"`
	ExpectedThreshold string `json:"expectedThreshold"`
	ActualCovered     string `json:"actualCovered"`
}

func OutputDTOFromCovErrors

func OutputDTOFromCovErrors(covErrs []evaluation.CoverageError) []ErrorOutputDTO

type FileOutputDTO

type FileOutputDTO struct {
	Coverage CoverageOutputDTO `json:"coverage"`
	Funcs    FuncsOutputDTO    `json:"funcs,omitempty"`
}

type FilesOutputDTO

type FilesOutputDTO map[string]FileOutputDTO

type Formatter

type Formatter func(OutputDTO) (string, error)

type FuncsOutputDTO

type FuncsOutputDTO map[string]CoverageOutputDTO

type LimgoConfig

type LimgoConfig struct {
	CoverageConfig  `json:"coverage"`
	StatisticConfig `json:"statistic"`
}

func ConfigFromJSONString

func ConfigFromJSONString(r io.Reader) (LimgoConfig, error)

func (LimgoConfig) ToJSON

func (config LimgoConfig) ToJSON(w io.Writer) error

type Matcher

type Matcher map[string]Threshold

type OutputDTO

type OutputDTO struct {
	Statistic      *StatisticOutputDTO `json:"statistic,omitempty"`
	CoverageErrors []ErrorOutputDTO    `json:"coverageErrors,omitempty"`
}

func NewOutputDTO

func NewOutputDTO(stats *statistic.ModuleStatistic, covErrs []evaluation.CoverageError) OutputDTO

type StatisticConfig

type StatisticConfig struct {
	Excludes []string `json:"excludes"`
}

type StatisticOutputDTO

type StatisticOutputDTO struct {
	Module      string               `json:"module"`
	Coverage    CoverageOutputDTO    `json:"coverage"`
	Directories DirectoriesOutputDTO `json:"directories,omitempty"`
}

func OutputDTOFromStatistic

func OutputDTOFromStatistic(stats *statistic.ModuleStatistic) StatisticOutputDTO

type Threshold

type Threshold struct {
	Statements float64 `json:"statements"`
	Lines      float64 `json:"lines"`
	Branches   float64 `json:"branches"`
	Functions  float64 `json:"functions"`
}

Jump to

Keyboard shortcuts

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