coverage

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package coverage provides protocol field coverage analysis.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FieldCoverage

type FieldCoverage struct {
	Name         string   `json:"name"`
	Type         string   `json:"type"`
	ObservedVals []string `json:"observed_values"`
	TotalValues  int      `json:"total_values,omitempty"` // for enums
	Covered      bool     `json:"covered"`
}

FieldCoverage tracks coverage for a single field.

type Report

type Report struct {
	Protocol string          `json:"protocol"`
	Fields   []FieldCoverage `json:"fields"`
	Total    int             `json:"total_fields"`
	Covered  int             `json:"covered_fields"`
	Percent  float64         `json:"coverage_percent"`
}

Report holds coverage analysis results.

func NewReport

func NewReport(protocol string) *Report

NewReport creates a new coverage report.

func (*Report) AddField

func (r *Report) AddField(name, typ string, observed []string, totalEnum int)

AddField adds a field coverage entry.

func (*Report) ToHTML

func (r *Report) ToHTML() string

ToHTML returns the report as HTML.

func (*Report) ToJSON

func (r *Report) ToJSON() string

ToJSON returns the report as JSON.

func (*Report) ToText

func (r *Report) ToText() string

ToText returns a text summary.

Jump to

Keyboard shortcuts

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