restcoverage

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

README

DOCUMENTATION DEPRECATION NOTICE: This file is deprecated. Please refer to the new migrated location. Please do not edit this file; instead, make changes to the new location!

The new location is served on the web at https://docs.prow.k8s.io/docs/.

This file will be deleted on 2023-02-28.

Documentation

Index

Constants

View Source
const (
	// DefaultWarningThreshold returns default threshold for warning class
	DefaultWarningThreshold = 40.0
	// DefaultErrorThreshold returns default threshold for error class
	DefaultErrorThreshold = 10.0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Coverage

type Coverage struct {
	UniqueHits         int                             `json:"uniqueHits"`
	ExpectedUniqueHits int                             `json:"expectedUniqueHits"`
	Percent            float64                         `json:"percent"`
	Endpoints          map[string]map[string]*Endpoint `json:"endpoints"`
	*Thresholds
}

Coverage represents a REST API statistics

type Endpoint

type Endpoint struct {
	Params             `json:"params"`
	UniqueHits         int     `json:"uniqueHits"`
	ExpectedUniqueHits int     `json:"expectedUniqueHits"`
	Percent            float64 `json:"percent"`
	MethodCalled       bool    `json:"methodCalled"`
}

Endpoint represents a basic statistics structure which is used to calculate REST API coverage

type Lens

type Lens struct{}

func (Lens) Body

func (lens Lens) Body(artifacts []api.Artifact, resourceDir string, data string, config json.RawMessage, spyglassConfig config.Spyglass) string

Body returns the displayed HTML for the <body>

func (Lens) Callback

func (lens Lens) Callback(artifacts []api.Artifact, resourceDir string, data string, config json.RawMessage, spyglassConfig config.Spyglass) string

func (Lens) Config

func (lens Lens) Config() lenses.LensConfig

Config returns the lens's configuration.

func (Lens) Header

func (lens Lens) Header(artifacts []api.Artifact, resourceDir string, config json.RawMessage, spyglassConfig config.Spyglass) string

Header returns the content of <head>

type Node

type Node struct {
	Hits  int              `json:"hits"`
	Items map[string]*Node `json:"items,omitempty"`
}

Node represents a single data unit for coverage report

type Params

type Params struct {
	Body  Trie `json:"body"`
	Query Trie `json:"query"`
}

Params represents body and query parameters

type Thresholds

type Thresholds struct {
	Warning float64 `json:"threshold_warning"`
	Error   float64 `json:"threshold_error"`
}

Thresholds sets color (yellow or red) to highlight coverage percent

type Trie

type Trie struct {
	Root               Node `json:"root"`
	UniqueHits         int  `json:"uniqueHits"`
	ExpectedUniqueHits int  `json:"expectedUniqueHits"`
	Size               int  `json:"size"`
	Height             int  `json:"height"`
}

Trie represents a coverage data

Jump to

Keyboard shortcuts

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