Documentation
¶
Overview ¶
Package catalog turns what an agent sees, a product name or a container image reference, into the identifiers the advisory sources need. A name it does not know is reported as unrecognised; it never guesses.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseImage ¶
ParseImage splits an image reference into its repository path, lower-cased and without the registry host, and its tag. A digest is discarded: it identifies the image but says nothing about the version.
func VersionFromTag ¶
VersionFromTag extracts a version from an image tag such as "main-v1.106.6-stable" or "19.6.1-ee.0". It returns "" when the tag holds no dotted version.
Types ¶
type Catalog ¶
type Catalog struct {
// contains filtered or unexported fields
}
Catalog holds the products the server recognises.
func New ¶
New loads the built-in catalog and, when extraPath is not empty, a team's own catalog file in the same format. An entry in the file replaces a built-in entry of the same name; any other entry is added. Both are validated, so a mistake in the file stops the server at start-up instead of producing wrong answers later.
func (*Catalog) ResolveImage ¶
ResolveImage finds the product a container image belongs to and reads the version from its tag. tagVersion is "" when the tag carries none, as with "latest" or a bare digest; it is returned even when the image is unknown.
type Product ¶
type Product struct {
Name string `yaml:"name"`
Aliases []string `yaml:"aliases"`
Ecosystem string `yaml:"ecosystem"`
Package string `yaml:"package"`
Repo string `yaml:"repo"`
GitLabRepo string `yaml:"gitlabRepo"`
CPE string `yaml:"cpe"`
Images []string `yaml:"images"`
}
Product is one known piece of software.