view

package
v0.0.0-...-75da391 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

README

View

This package contains types and helper methods that repos can use to display API Coverage results.

DisplayRules provides a mechanism for repos to define their own display rules. DisplayHelper methods can use these rules to define how to display results.

GetHTMLDisplay() is a utility method that can be used by repos to get a HTML(JSON) like textual display of API Coverage. This method takes an array of TypeCoverage and DisplayRules object and returns a string representing its coverage in the color coded format inside a HTML page:

Package: <PackageName>
Type: <TypeName>
{
    <FieldName> <Ignored>/<Coverage:TrueorFalse> [Values]
    ....
    ....
    ....
}

GetHTMLCoverageValuesDisplay() is a utility method that can be used by repos to produce coverage values display. The method takes as input CoverageValue and produces a display in the format inside a HTML page:

CoverageValues:

Total Fields:  <Number of total fields>
Covered Fields: <Number of fields covered>
Ignored Fields: <Number of fields ignored>
Coverage Percentage: <Percentage value of coverage>

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHTMLCoverageValuesDisplay

func GetHTMLCoverageValuesDisplay(coverageValues *coveragecalculator.CoverageValues) (string, error)

GetHTMLCoverageValuesDisplay is a helper method to display coverage values inside a HTML table.

func GetHTMLDisplay

func GetHTMLDisplay(coverageData []coveragecalculator.TypeCoverage, coverageValues *coveragecalculator.CoverageValues) (string, error)

GetHTMLDisplay is a helper method to display API Coverage details in json-like format inside a HTML page.

Types

type DisplayRules

type DisplayRules struct {
	PackageNameRule func(packageName string) string
	TypeNameRule    func(typeName string) string
	FieldRule       func(coverage *coveragecalculator.FieldCoverage) string
}

DisplayRules provides a mechanism for repos to define their own display rules. DisplayHelper methods can use these rules to define how to display results.

type HtmlDisplayData

type HtmlDisplayData struct {
	TypeCoverages   []coveragecalculator.TypeCoverage
	CoverageNumbers *coveragecalculator.CoverageValues
}

Jump to

Keyboard shortcuts

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