Documentation
¶
Overview ¶
Package gocovsta implements the parsing and conversion logic for transforming Cobertura XML coverage reports into JSON output, for consumption by the Bitbucket Server code coverage plugin API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Class ¶
type Class struct {
Name string `xml:"name,attr"`
Filename string `xml:"filename,attr"`
LineRate float32 `xml:"line-rate,attr"`
BranchRate float32 `xml:"branch-rate,attr"`
Complexity float32 `xml:"complexity,attr"`
Methods []Method `xml:"methods>method"`
Lines []Line `xml:"lines>line"`
LineCount int64 `xml:"line-count,attr"`
LineHits int64 `xml:"line-hits,attr"`
}
Class input data.
type Coverage ¶
type Coverage struct {
XMLName xml.Name `xml:"coverage"`
LineRate float32 `xml:"line-rate,attr"`
BranchRate float32 `xml:"branch-rate,attr"`
LinesCovered float32 `xml:"lines-covered,attr"`
LinesValid int64 `xml:"lines-valid,attr"`
BranchesCovered int64 `xml:"branches-covered,attr"`
BranchesValid int64 `xml:"branches-valid,attr"`
Complexity float32 `xml:"complexity,attr"`
Version string `xml:"version,attr"`
Timestamp int64 `xml:"timestamp,attr"`
Packages []Package `xml:"packages>package"`
Sources []string `xml:"sources>source"`
}
Coverage input data.
type File ¶
type File struct {
Path string `json:"path"`
Coverage string `json:"coverage"`
// contains filtered or unexported fields
}
File JSON type.
type Method ¶
type Method struct {
Name string `xml:"name,attr"`
Signature string `xml:"signature,attr"`
LineRate float32 `xml:"line-rate,attr"`
BranchRate float32 `xml:"branch-rate,attr"`
Complexity float32 `xml:"complexity,attr"`
Lines []Line `xml:"lines>line"`
LineCount int64 `xml:"line-count,attr"`
LineHits int64 `xml:"line-hits,attr"`
}
Method input data.
type Output ¶
type Output struct {
Files []File `json:"files"`
}
Output JSON type.
func ParseCoverage ¶
ParseCoverage parses the input XML data and generates the Output for marshalling to JSON.
type Package ¶
type Package struct {
Name string `xml:"name,attr"`
LineRate float32 `xml:"line-rate,attr"`
BranchRate float32 `xml:"branch-rate,attr"`
Complexity float32 `xml:"complexity,attr"`
Classes []Class `xml:"classes>class"`
LineCount int64 `xml:"line-count,attr"`
LineHits int64 `xml:"line-hits,attr"`
}
Package input data.
Click to show internal directories.
Click to hide internal directories.