localview

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 15 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package localview derives what a viewer shows for scans on the reader's own machine: the map, the findings' words and the stack labels for one scan, and what changed between two. It reads only the bytes it is given.

Index

Constants

View Source
const (
	MaxBytes = 50 << 20
	MaxDepth = 64
)

The largest facts file the viewer reads, and the deepest nesting of objects and arrays in it. A real scan is a few megabytes and about ten levels deep; past these the page would freeze rather than show anything.

Variables

This section is empty.

Functions

func Compare

func Compare(a, b []byte) ([]byte, error)

Compare derives two scans' views and what changed between them, the older commit first whichever file comes first. Two commits with the same date are ordered by sha.

func Of

func Of(facts []byte) ([]byte, error)

Of derives one scan's view from its facts file.

Types

type Changes

type Changes struct {
	From      View               `json:"from"`
	To        View               `json:"to"`
	Groups    []drift.DriftGroup `json:"groups"`
	MapGroups []drift.DriftGroup `json:"map_groups"`
	Drift     *drift.Drift       `json:"drift"`
}

Changes is two scans of one repository, the older first, and what changed.

type View

type View struct {
	Scan        json.RawMessage   `json:"scan"`
	Map         *rules.Map        `json:"map"`
	Explain     []explain.Rule    `json:"explain"`
	StackLabels map[string]string `json:"stack_labels"`
	// Dependencies is the scan's dependencies by service.
	Dependencies depview.Summary `json:"dependencies"`
}

View is one scan as a viewer shows it.

Jump to

Keyboard shortcuts

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