pkg

package
v0.103.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2025 License: Apache-2.0 Imports: 35 Imported by: 23

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasJvmPackageName added in v0.80.2

func HasJvmPackageName(name string) bool

func Provide

func Provide(userInput string, config ProviderConfig) ([]Package, Context, *sbom.SBOM, error)

Provide a set of packages and context metadata describing where they were sourced from.

func VersionFormat added in v0.97.0

func VersionFormat(p Package) version.Format

Types

type ApkFileRecord added in v0.74.0

type ApkFileRecord struct {
	Path string `json:"path"`
}

ApkFileRecord represents a single file listing and metadata from a APK DB entry (which may have many of these file records).

type ApkMetadata added in v0.17.1

type ApkMetadata struct {
	Files []ApkFileRecord `json:"files"`
}

type CPELiteralMetadata added in v0.88.0

type CPELiteralMetadata struct {
	CPE string
}

type Context

type Context struct {
	Source *source.Description
	Distro *distro.Distro
}

type Digest added in v0.35.0

type Digest struct {
	Algorithm string `json:"algorithm"`
	Value     string `json:"value"`
}

type DistroConfig added in v0.97.0

type DistroConfig struct {
	Override    *distro.Distro
	FixChannels []distro.FixChannel
}

type Enhancer added in v0.92.0

type Enhancer func(out *Package, purl packageurl.PackageURL, pkg syftPkg.Package)

type GolangBinMetadata added in v0.43.0

type GolangBinMetadata struct {
	BuildSettings     pkg.KeyValues `json:"goBuildSettings,omitempty" cyclonedx:"goBuildSettings"`
	GoCompiledVersion string        `json:"goCompiledVersion" cyclonedx:"goCompiledVersion"`
	Architecture      string        `json:"architecture" cyclonedx:"architecture"`
	H1Digest          string        `json:"h1Digest,omitempty" cyclonedx:"h1Digest"`
	MainModule        string        `json:"mainModule,omitempty" cyclonedx:"mainModule"`
	GoCryptoSettings  []string      `json:"goCryptoSettings,omitempty" cyclonedx:"goCryptoSettings"`
}

type GolangModMetadata added in v0.56.0

type GolangModMetadata struct {
	H1Digest string `json:"h1Digest,omitempty"`
}

type GolangSourceMetadata added in v0.99.0

type GolangSourceMetadata struct {
	H1Digest        string `json:"h1Digest,omitempty"`
	OperatingSystem string `json:"os,omitempty"`
	Architecture    string `json:"architecture,omitempty"`
	BuildTags       string `json:"buildTags,omitempty"`
	CgoEnabled      bool   `json:"cgoEnabled"`
}

type ID

type ID string

ID represents a unique value for each package added to a package collection.

type JavaMetadata

type JavaMetadata struct {
	VirtualPath    string   `json:"virtualPath"`
	PomArtifactID  string   `json:"pomArtifactID"`
	PomGroupID     string   `json:"pomGroupID"`
	ManifestName   string   `json:"manifestName"`
	ArchiveDigests []Digest `json:"archiveDigests"`
}

type JavaVMInstallationMetadata added in v0.80.2

type JavaVMInstallationMetadata struct {
	Release JavaVMReleaseMetadata `json:"release,omitempty"`
}

type JavaVMReleaseMetadata added in v0.80.2

type JavaVMReleaseMetadata struct {
	JavaRuntimeVersion string `json:"javaRuntimeVersion,omitempty"`
	JavaVersion        string `json:"javaVersion,omitempty"`
	FullVersion        string `json:"fullVersion,omitempty"`
	SemanticVersion    string `json:"semanticVersion,omitempty"`
}

type PURLLiteralMetadata added in v0.86.1

type PURLLiteralMetadata struct {
	PURL string
}

type Package

type Package struct {
	ID        ID
	Name      string           // the package name
	Version   string           // the version of the package
	Locations file.LocationSet // the locations that lead to the discovery of this package (note: this is not necessarily the locations that make up this package)
	Language  syftPkg.Language // the language ecosystem this package belongs to (e.g. JavaScript, Python, etc)
	Distro    *distro.Distro   // a specific distro this package originated from
	Licenses  []string
	Type      syftPkg.Type // the package type (e.g. Npm, Yarn, Python, Rpm, Deb, etc)
	CPEs      []cpe.CPE    // all possible Common Platform Enumerators
	PURL      string       // the Package URL (see https://github.com/package-url/purl-spec)
	Upstreams []UpstreamPackage
	Metadata  interface{} // This is NOT 1-for-1 the syft metadata! Only the select data needed for vulnerability matching
}

Package represents an application or library that has been bundled into a distributable format.

func ByID

func ByID(id ID, pkgs []Package) *Package

func FromCollection added in v0.62.0

func FromCollection(catalog *syftPkg.Collection, config SynthesisConfig, enhancers ...Enhancer) []Package

func FromPackages added in v0.54.0

func FromPackages(syftPkgs []syftPkg.Package, config SynthesisConfig, enhancers ...Enhancer) []Package

func New

func New(p syftPkg.Package, enhancers ...Enhancer) Package

func UpstreamPackages added in v0.33.0

func UpstreamPackages(p Package) (pkgs []Package)

func (Package) String

func (p Package) String() string

type ProviderConfig added in v0.30.0

type ProviderConfig struct {
	SyftProviderConfig
	SynthesisConfig
}

type RpmMetadata added in v0.50.0

type RpmMetadata struct {
	Epoch           *int    `json:"epoch" cyclonedx:"epoch"`
	ModularityLabel *string `json:"modularityLabel" cyclonedx:"modularityLabel"`
}

type SBOMFileMetadata added in v0.92.0

type SBOMFileMetadata struct {
	Path string
}

type SyftProviderConfig added in v0.54.0

type SyftProviderConfig struct {
	SBOMOptions            *syft.CreateSBOMConfig
	RegistryOptions        *image.RegistryOptions
	Platform               string
	Exclusions             []string
	Name                   string
	DefaultImagePullSource string
}

type SynthesisConfig added in v0.54.0

type SynthesisConfig struct {
	GenerateMissingCPEs bool
	Distro              DistroConfig
}

type UpstreamPackage added in v0.33.0

type UpstreamPackage struct {
	Name    string // the package name
	Version string // the version of the package
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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