output

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DistinctStdlibVulnIDs added in v0.3.0

func DistinctStdlibVulnIDs(bumps []gobump.StdlibBump) []string

DistinctStdlibVulnIDs returns a file's distinct fixable stdlib vulnerability IDs across all of its StdlibBump entries, sorted for deterministic display. gobump.evaluateStdlibStaleness records one StdlibBump per go-package pin constraint, so the same vulnerability ID can recur across constraints (e.g. a package pinning both go1.22 and go1.23 toolchains, both affected by the same stdlib CVE) - callers that count or list stdlib vulnerabilities per file must dedupe via this function rather than summing len(bump.VulnIDs) across bumps.

func ExtractFilename

func ExtractFilename(path string) string

ExtractFilename extracts the filename (with extension) from a full file path

func OutputJSON

func OutputJSON(w io.Writer, data any) error

OutputJSON writes data as formatted JSON to the given writer

func OutputYAML

func OutputYAML(w io.Writer, data any) error

OutputYAML writes data as formatted YAML to the given writer

Types

type CheckResponse

type CheckResponse struct {
	Results map[string]*updater.UpdateResult `json:"results" yaml:"results"`
	Summary CheckSummary                     `json:"summary" yaml:"summary"`
}

CheckResponse wraps check command results with summary metadata

type CheckSummary

type CheckSummary struct {
	TotalPackages    int `json:"total_packages" yaml:"total_packages"`
	UpdatesAvailable int `json:"updates_available" yaml:"updates_available"`
	Errors           int `json:"errors" yaml:"errors"`
	Manual           int `json:"manual" yaml:"manual"`
}

CheckSummary provides aggregate statistics for check command

type GoBumpResponse

type GoBumpResponse struct {
	Results map[string]*gobump.GoBumpResult `json:"results" yaml:"results"`
	Summary GoBumpSummary                   `json:"summary" yaml:"summary"`
}

GoBumpResponse wraps gobump command results with summary metadata

type GoBumpSummary

type GoBumpSummary struct {
	TotalPackages       int `json:"total_packages" yaml:"total_packages"`
	PackagesWithVulns   int `json:"packages_with_vulns" yaml:"packages_with_vulns"`
	PackagesFixed       int `json:"packages_fixed" yaml:"packages_fixed"`
	PackagesPartial     int `json:"packages_partial" yaml:"packages_partial"`
	PackagesUnvalidated int `json:"packages_unvalidated" yaml:"packages_unvalidated"`
	TotalVulnsFound     int `json:"total_vulns_found" yaml:"total_vulns_found"`
	TotalVulnsFixed     int `json:"total_vulns_fixed" yaml:"total_vulns_fixed"`
	TotalVulnsResidual  int `json:"total_vulns_residual" yaml:"total_vulns_residual"`
	// TotalVulnsUnreachable counts advisories affecting only modules not
	// linked into any build artifact (informational; not fixed, not residual).
	TotalVulnsUnreachable int `json:"total_vulns_unreachable" yaml:"total_vulns_unreachable"`
	TotalModulesBumped    int `json:"total_modules_bumped" yaml:"total_modules_bumped"`
	Errors                int `json:"errors" yaml:"errors"`

	// PackagesStdlibStale counts files with at least one distinct fixable
	// stdlib vulnerability ID (see DistinctStdlibVulnIDs); TotalStdlibVulns
	// sums those per-file distinct counts across all files. Deliberately
	// separate from the dependency-vulnerability counters above: a stdlib
	// staleness fix is a toolchain rebuild, not a dependency bump, and a file
	// can carry stdlib fixes with zero dependency vulnerabilities found.
	PackagesStdlibStale int `json:"packages_stdlib_stale" yaml:"packages_stdlib_stale"`
	TotalStdlibVulns    int `json:"total_stdlib_vulns" yaml:"total_stdlib_vulns"`
}

GoBumpSummary provides aggregate statistics for gobump command. Vuln counts are advisories; TotalModulesBumped counts changed dependency entries.

type UpdateResponse

type UpdateResponse struct {
	Results map[string]*updater.ApplyResult `json:"results" yaml:"results"`
	Summary UpdateSummary                   `json:"summary" yaml:"summary"`
}

UpdateResponse wraps update command results with summary metadata

type UpdateSummary

type UpdateSummary struct {
	TotalPackages     int `json:"total_packages" yaml:"total_packages"`
	SuccessfulUpdates int `json:"successful_updates" yaml:"successful_updates"`
	Errors            int `json:"errors" yaml:"errors"`
	Manual            int `json:"manual" yaml:"manual"`
}

UpdateSummary provides aggregate statistics for update command

Jump to

Keyboard shortcuts

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