Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CoveragePercentages ¶
type CoveragePercentages struct { // ResourceCoverages maps percentage coverage per resource. ResourceCoverages map[string]float64 }
CoveragePercentages encapsulate percentage coverage for resources.
func (*CoveragePercentages) GetAndRemoveResourceValue ¶
func (c *CoveragePercentages) GetAndRemoveResourceValue(resource string) float64
GetAndRemoveResourceValue utility method to implement "get and delete" semantics. This makes templating operations easy.
func (*CoveragePercentages) IsFailedBuild ¶
func (c *CoveragePercentages) IsFailedBuild() bool
IsFailedBuild utility method to indicate if CoveragePercentages indicate values of a failed build.
type CoverageValues ¶
type CoverageValues struct { TotalFields int CoveredFields int IgnoredFields int PercentCoverage float64 }
CoverageValues encapsulates all the coverage related values.
func CalculateTypeCoverage ¶
func CalculateTypeCoverage(typeCoverage []TypeCoverage) *CoverageValues
CalculateTypeCoverage calculates aggregate coverage values based on provided []TypeCoverage
func (*CoverageValues) CalculatePercentageValue ¶
func (c *CoverageValues) CalculatePercentageValue()
CalculatePercentageValue calculates percentage value based on other fields.
type FieldCoverage ¶
type FieldCoverage struct { Field string `json:"Field"` Values sets.String `json:"Values"` Coverage bool `json:"Covered"` Ignored bool `json:"Ignored"` }
FieldCoverage represents coverage data for a field.
func (*FieldCoverage) GetValues ¶
func (f *FieldCoverage) GetValues() []string
GetValues returns Values as slice
func (*FieldCoverage) GetValuesForDisplay ¶
func (f *FieldCoverage) GetValuesForDisplay() string
GetValuesForDisplay returns value strings as comma separated string.
type IgnoredFields ¶
type IgnoredFields struct {
// contains filtered or unexported fields
}
IgnoredFields encapsulates fields to be ignored in a package for API coverage calculation.
func (*IgnoredFields) FieldIgnored ¶
func (ig *IgnoredFields) FieldIgnored(packageName string, typeName string, fieldName string) bool
FieldIgnored method given a package, type and field returns true if the field is marked ignored.
func (*IgnoredFields) ReadFromFile ¶
func (ig *IgnoredFields) ReadFromFile(filePath string) error
ReadFromFile is a utility method that can be used by repos to read .yaml input file into IgnoredFields type.
type TypeCoverage ¶
type TypeCoverage struct { Package string `json:"Package"` Type string `json:"Type"` Fields map[string]*FieldCoverage `json:"Fields"` }
TypeCoverage encapsulates type information and field coverage.