models

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const PKGNAME_SEPARATOR = "/"

Variables

View Source
var (
	ErrNoProfiles     = errors.New("no profiles")
	ErrNoCommonPrefix = errors.New("cannot guess module name from file names")
)

Functions

func ParseBlocks

func ParseBlocks(blocks []cover.ProfileBlock) (lines []Line, c Coverage)

Types

type Counters

type Counters struct {
	Covered, Count int
}

func (Counters) Rate

func (c Counters) Rate() float64

type Coverage

type Coverage struct {
	Line Counters
	Stmt Counters
}

type File

type File struct {
	Name  string
	Path  string
	Lines []Line
	Coverage
}

func MakeFile

func MakeFile(name, path string, lines []Line, c Coverage) File

func (File) PackageName

func (f File) PackageName() string

type Line

type Line struct {
	Number int
	Count  int
}

type Module

type Module struct {
	Name     string
	Packages []Package
	Coverage
}

func MakeModule

func MakeModule(name string, packages ...Package) Module

type Package

type Package struct {
	Name  string
	Files []File
	Coverage
}

func MakePackage

func MakePackage(name string, files ...File) Package

type Parser

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

func NewParser

func NewParser() *Parser

func (*Parser) Compile

func (p *Parser) Compile() Report

func (*Parser) Record

func (p *Parser) Record(modName string, profs []*cover.Profile) (err error)

type Report

type Report struct {
	Modules []Module
	Coverage
}

func MakeReport

func MakeReport(modules ...Module) Report

Jump to

Keyboard shortcuts

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