Documentation ¶
Index ¶
- Constants
- type Coverage
- type Endpoint
- type Lens
- func (lens Lens) Body(artifacts []api.Artifact, resourceDir string, data string, ...) string
- func (lens Lens) Callback(artifacts []api.Artifact, resourceDir string, data string, ...) string
- func (lens Lens) Config() lenses.LensConfig
- func (lens Lens) Header(artifacts []api.Artifact, resourceDir string, config json.RawMessage, ...) string
- type Node
- type Params
- type Thresholds
- type Trie
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) Config ¶
func (lens Lens) Config() lenses.LensConfig
Config returns the lens's configuration.
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
Click to show internal directories.
Click to hide internal directories.