models

package
v0.9.15 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cycle

type Cycle struct {
	ProductName       string
	ProductPermalink  string
	ReleaseCycle      string
	Eol               string
	LatestRelease     string
	LatestReleaseDate string
	ReleaseDate       string
}

func NewCycle

func NewCycle(c eol.Cycle) Cycle

type Document

type Document struct {
	Matches    []Match      `json:"matches"`
	Source     *source      `json:"source"`
	Distro     distribution `json:"distro"`
	Descriptor descriptor   `json:"descriptor"`
}

Document represents the JSON document to be presented

func NewDocument

func NewDocument(packages []pkg.Package, context pkg.Context, matches match.Matches, appConfig interface{}, dbStatus interface{}) (Document, error)

NewDocument creates and populates a new Document struct, representing the populated JSON document.

type Match

type Match struct {
	Cycle    Cycle
	Package  pkg.Package // The package used to search for a match.
	Artifact Package     `json:"artifact"`
}

Match is a single item for the JSON array reported

type MatchDetails

type MatchDetails struct {
	Type       string      `json:"type"`
	Matcher    string      `json:"matcher"`
	SearchedBy interface{} `json:"searchedBy"`
	Found      interface{} `json:"found"`
}

MatchDetails contains all data that indicates how the result match was found

type MatchSort added in v0.9.0

type MatchSort []Match

func (MatchSort) Len added in v0.9.0

func (m MatchSort) Len() int

Len is the number of elements in the collection.

func (MatchSort) Less added in v0.9.0

func (m MatchSort) Less(i, j int) bool

Less reports whether the element with index i should sort before the element with index j.

func (MatchSort) Swap added in v0.9.0

func (m MatchSort) Swap(i, j int)

Swap swaps the elements with indexes i and j.

type Package

type Package struct {
	Name         string             `json:"name"`
	Version      string             `json:"version"`
	Type         syftPkg.Type       `json:"type"`
	Locations    []file.Coordinates `json:"locations"`
	Language     syftPkg.Language   `json:"language"`
	Licenses     []string           `json:"licenses"`
	CPEs         []string           `json:"cpes"`
	PURL         string             `json:"purl"`
	Upstreams    []UpstreamPackage  `json:"upstreams"`
	MetadataType pkg.MetadataType   `json:"metadataType,omitempty"`
	Metadata     interface{}        `json:"metadata,omitempty"`
}

Package is meant to be only the fields that are needed when displaying a single pkg.Package object for the JSON presenter.

type PresenterConfig

type PresenterConfig struct {
	Matches   match.Matches
	Packages  []pkg.Package
	Context   pkg.Context
	SBOM      *sbom.SBOM
	AppConfig interface{}
	DBStatus  interface{}
}

type UpstreamPackage

type UpstreamPackage struct {
	Name    string `json:"name"`
	Version string `json:"version,omitempty"`
}

Jump to

Keyboard shortcuts

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