depview

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: 3 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 depview groups one scan's dependencies by service: the direct ones the attach rule puts on a service, and the transitive ones its manifest folders reach through the lockfiles. What no service carries is grouped last, as "not on a service".

Index

Constants

View Source
const Rest = "not on a service"

Rest is the name of the group for dependencies on no service.

Variables

This section is empty.

Functions

func Count

func Count(services []Service) map[string]int

Count counts the distinct dependencies of services: direct, transitive, licence_declared, and by change new, upgraded and changed (downgraded or another version change).

func Str

func Str(f fact.Fact, k string) string

Str is a string attribute of a fact, or "".

Types

type Dep

type Dep struct {
	Key        string   `json:"key"`
	Ecosystem  string   `json:"ecosystem"`
	Name       string   `json:"name"`
	Version    string   `json:"version,omitempty"`
	Scope      string   `json:"scope,omitempty"`   // prod, dev, unknown
	Licence    string   `json:"licence,omitempty"` // as declared; empty: not declared
	Direct     bool     `json:"direct"`
	Via        []string `json:"via,omitempty"`
	Path       string   `json:"path"`
	Line       int      `json:"line"`
	Change     string   `json:"change,omitempty"` // new, upgraded, downgraded, changed; empty: unchanged or no comparison
	WasVersion string   `json:"was_version,omitempty"`
}

Dep is one dependency as a view lists it.

func FromFact

func FromFact(f fact.Fact) Dep

FromFact is a dependency fact as a Dep, unmarked.

type Service

type Service struct {
	Service    string `json:"service"` // key; "" for what no service carries
	Name       string `json:"name"`
	Direct     []Dep  `json:"direct"`
	Transitive []Dep  `json:"transitive"`
}

Service is the dependencies of one service.

func Group

func Group(to *fact.Scan, m *rules.Map, mark func(*Dep)) []Service

Group lists scan to's dependencies per service, services by key and the rest last, each list by key. mark, when not nil, is called on every Dep before it is listed (a comparison sets Change there). Dependencies marked internal are left out.

type Summary

type Summary struct {
	Services []Service      `json:"services"`
	Counts   map[string]int `json:"counts"`
}

Summary is one scan's dependencies by service and their counts.

func Of

func Of(to *fact.Scan, m *rules.Map) Summary

Of is one scan's dependencies by service, with no comparison.

Jump to

Keyboard shortcuts

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