helpers

package
v0.5.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	PurlTypeGuac  = "guac"
	PurlFilesGuac = "pkg:guac/files/"
	PurlPkgGuac   = "pkg:guac/pkg/"
)

Variables

This section is empty.

Functions

func AllPkgTreeToPurl added in v0.5.0

func AllPkgTreeToPurl(v *model.AllPkgTree) string

AllPkgTreeToPurl takes one package trie evaluation and converts it into a PURL it will only do this for one PURL, and will ignore other pkg tries in the fragment

func ArtifactClientKey added in v0.5.0

func ArtifactClientKey(input *generated.ArtifactInputSpec) string

func ArtifactServerKey added in v0.5.0

func ArtifactServerKey(input *model.ArtifactInputSpec) string

func CreateVulnInput added in v0.2.0

func CreateVulnInput(vulnID string) (*generated.VulnerabilityInputSpec, error)

func GetKey added in v0.5.0

func GetKey[T any, R any](item T, transformer func(T) R) R

collect is a simple helper to transform collections of a certain type to another type using the transform function func(T) R

func GuacFilePurl

func GuacFilePurl(alg string, digest string, filename *string) string

func GuacGenericPurl

func GuacGenericPurl(s string) string

func GuacPkgPurl

func GuacPkgPurl(pkgName string, pkgVersion *string) string

func IsVcs

func IsVcs(s string) bool

func LicenseClientKey added in v0.5.0

func LicenseClientKey(l *generated.LicenseInputSpec) string

func LicenseServerKey added in v0.5.0

func LicenseServerKey(l *model.LicenseInputSpec) string

func PkgInputSpecToPurl added in v0.1.1

func PkgInputSpecToPurl(currentPkg *model.PkgInputSpec) string

func PkgToPurl

func PkgToPurl(purlType, namespace, name, version, subpath string, qualifiersList []string) string

func PurlToPkg

func PurlToPkg(purlUri string) (*model.PkgInputSpec, error)

PurlToPkg converts a purl URI string into a graphql package node

func SanitizeString

func SanitizeString(s string) string

func UpdatePurlForPackageNamespaces added in v0.4.0

func UpdatePurlForPackageNamespaces(packageObj *model.Package) ([]*model.PackageNamespace, error)

func VcsToSrc

func VcsToSrc(vcsUri string) (*model.SourceInputSpec, error)

Types

type PkgIds added in v0.5.0

type PkgIds struct {
	TypeId      string
	NamespaceId string
	NameId      string
	VersionId   string
}

func PkgClientKey added in v0.5.0

func PkgClientKey(pkg *generated.PkgInputSpec) PkgIds

func PkgServerKey added in v0.5.0

func PkgServerKey(pkg *model.PkgInputSpec) PkgIds

type SrcIds added in v0.5.0

type SrcIds struct {
	TypeId      string
	NamespaceId string
	NameId      string
}

func SrcClientKey added in v0.5.0

func SrcClientKey(src *generated.SourceInputSpec) SrcIds

func SrcServerKey added in v0.5.0

func SrcServerKey(src *model.SourceInputSpec) SrcIds

type VulnIds added in v0.5.0

type VulnIds struct {
	TypeId          string
	VulnerabilityID string
}

func VulnClientKey added in v0.5.0

func VulnClientKey(vuln *generated.VulnerabilityInputSpec) VulnIds

func VulnServerKey added in v0.5.0

func VulnServerKey(vuln *model.VulnerabilityInputSpec) VulnIds

Jump to

Keyboard shortcuts

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