Documentation
¶
Overview ¶
Package graph is the lineage graph strata renders: nodes for images, external roots and phantom ancestors, edges with their provenance, and the budget rules that keep a descendant tree of a popular base readable.
Index ¶
Constants ¶
const ( KindImage = "image" KindExternal = "external" KindPhantom = "phantom" KindCollapsed = "collapsed" KindOverflow = "overflow" )
Node kinds.
const ( Ancestry = "ancestry" Descendants = "descendants" Query = "query" )
Graph kinds.
const DefaultBudget = 500
DefaultBudget is the node budget for rendered graphs.
const MaxBudget = 20000
MaxBudget is the hard cap on --budget, which keeps HTML output openable.
Variables ¶
This section is empty.
Functions ¶
func Label ¶
Label picks the most readable name for an image: its first tag ref that is not latest, then latest, then repo@short digest.
func ShortDigest ¶
ShortDigest abbreviates sha256:<hex> to sha256:<first 12 hex>.
Types ¶
type Edge ¶
type Edge struct {
Parent string `json:"parent"`
Child string `json:"child"`
Source string `json:"source"`
Confidence string `json:"confidence,omitempty"`
Conflict bool `json:"conflict,omitempty"`
}
Edge links a parent to a child.
type Graph ¶
type Graph struct {
Kind string `json:"kind"`
Root string `json:"root,omitempty"`
Title string `json:"title"`
Nodes []Node `json:"nodes"`
Edges []Edge `json:"edges"`
Hidden int `json:"hidden,omitempty"`
}
Graph is a set of nodes and edges of one kind.
func (*Graph) Budget ¶
Budget keeps a graph within a node budget. Children of one parent that share a repo collapse into one node first; if the graph is still too big, the deepest nodes are cut and each parent that lost children gets a "+N more" node. Nodes listed in keep are never collapsed or cut.
type Node ¶
type Node struct {
ID string `json:"id"`
Label string `json:"label"`
Repo string `json:"repo,omitempty"`
Refs []string `json:"refs,omitempty"`
Kind string `json:"kind"`
Verdict string `json:"verdict,omitempty"`
Reasons []string `json:"reasons,omitempty"`
// Note is a compact summary of the staleness signals, such as
// "base drift: 3 gens".
Note string `json:"note,omitempty"`
Created string `json:"created,omitempty"`
Size int64 `json:"size,omitempty"`
Layers int `json:"layers,omitempty"`
Depth int `json:"depth"`
Matched bool `json:"matched,omitempty"`
Count int `json:"count,omitempty"`
Members []string `json:"members,omitempty"`
Platform string `json:"platform,omitempty"`
}
Node is one vertex.