catalog

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: MIT Imports: 6 Imported by: 0 modules, 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 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

func ParseImage(reference string) (repository, tag string)

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

func VersionFromTag(tag string) string

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

func New(extraPath string) (*Catalog, error)

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) Products

func (c *Catalog) Products() []Product

Products returns the catalog's entries.

func (*Catalog) Resolve

func (c *Catalog) Resolve(name string) (Product, bool)

Resolve finds a product by name, alias or package name.

func (*Catalog) ResolveImage

func (c *Catalog) ResolveImage(reference string) (product Product, tagVersion string, ok bool)

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.

Jump to

Keyboard shortcuts

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