dxtypes

package
v1.3.5-beta9 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanMerge

func CanMerge(p *Package, p2 *Package) int

func CanMergeWithVersionRange

func CanMergeWithVersionRange(version, versionRange string) bool

p2 is version range

func CompareVersionRange

func CompareVersionRange(target, versionRange string) bool

func CreateCycloneDXSBOMByDXPackages added in v1.2.7

func CreateCycloneDXSBOMByDXPackages(pkgs []*Package) *cdx.BOM

func MarshalCycloneDXBomToJSON added in v1.2.7

func MarshalCycloneDXBomToJSON(bom *cdx.BOM) ([]byte, error)

Types

type Package

type Package struct {
	Name           string
	Version        string
	IsVersionRange bool // Version is a version range

	FromFile     []string
	FromAnalyzer []string

	// sha1:abc
	// md5:abc
	// sha256:abc
	// ...
	Verification string

	License []string

	// Related
	// id -> package
	UpStreamPackages   map[string]*Package
	DownStreamPackages map[string]*Package

	DependsOn PackageRelationShip

	Potential bool

	// 订正 CPE 和 强制关联 CVE
	AmendedCPE    []string
	AssociatedCVE []string
}

func (*Package) From

func (p *Package) From() ([]string, []string)

func (*Package) HasVersionRange

func (p *Package) HasVersionRange() bool

func (*Package) Identifier

func (p *Package) Identifier() string

func (*Package) LinkDepend

func (down *Package) LinkDepend(up *Package)

func (*Package) Merge

func (p *Package) Merge(p2 *Package) *Package

merge p2 to p1

func (*Package) SetFrom

func (p *Package) SetFrom(analyzer, file string)

func (Package) String

func (p Package) String() string

type PackageRelationShip

type PackageRelationShip struct {
	And map[string]string   // key: package name, value: version range
	Or  []map[string]string // key: package name, value: version range
}

type Service

type Service struct {
	// contab / systemctl / nginx
	ApplicationName string

	// config / network / fs / command
	ServiceType    string
	ServiceName    string
	ServiceContent string
}

Service for describing service config, for systemctl, crontab, rc[\d]{,2}.d/ nginx/httpd/apache2 config and docker containers ports / fs mount and soon.

Jump to

Keyboard shortcuts

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