Documentation
¶
Index ¶
- Constants
- Variables
- func CdxPackageTypeToXrayPackageType(cdxPackageType string) string
- func ConvertXrayPackageType(xrayPackageType string) string
- func DetectTechnologiesDescriptors(path string, recursive bool, requestedTechs []string, ...) (technologiesDetected map[Technology]map[string][]string, err error)
- func DetectedTechnologiesList() (technologies []string)
- func DetectedTechnologiesToSlice(detected map[Technology]map[string][]string) []string
- func IsValidTechnology(tech string) bool
- func PurlToXrayComponentId(purl string) (xrayComponentId string)
- func SplitComponentId(componentId string) (string, string, string)
- func SplitComponentIdRaw(componentId string) (string, string, string)
- func SplitPackageURL(purl string) (compName, compVersion, packageType string)
- func SplitPackageUrlWithQualifiers(purl string) (packageType, compNamespace, compName, compVersion string, ...)
- func ToCdxPackageType(packageType string) string
- func ToPackageRef(compName, version, packageType string) (output string)
- func ToPackageUrl(compName, version, packageType string, properties ...packageurl.Qualifier) (output string)
- func ToXrayComponentId(packageType, componentName, componentVersion string) string
- func XrayComponentIdToCdxComponentRef(xrayImpactedPackageId string) string
- func XrayComponentIdToPurl(xrayComponentId string) (purl string)
- type CodeLanguage
- type ContentValidator
- type TechData
- type Technology
- func (tech Technology) GetExecCommandName() string
- func (tech Technology) GetPackageDescriptor() []string
- func (tech Technology) GetPackageInstallationCommand() string
- func (tech Technology) GetPackageType() string
- func (tech Technology) GetPackageTypeId() string
- func (tech Technology) GetPackageVersionOperator() string
- func (tech Technology) String() string
- func (tech Technology) ToFormal() string
Constants ¶
const JfrogCleanTechSubModulesEnv = "JFROG_CLI_CLEAN_SUB_MODULES"
const Pypi = "pypi"
Variables ¶
var AllTechnologiesStrings = []string{ Maven.String(), Gradle.String(), Npm.String(), Pnpm.String(), Yarn.String(), Go.String(), Pip.String(), Pipenv.String(), Poetry.String(), Nuget.String(), Dotnet.String(), Docker.String(), Oci.String(), Conan.String(), Cocoapods.String(), Swift.String(), NoTech.String(), Gem.String(), }
var TechToProjectType = map[Technology]project.ProjectType{ Maven: project.Maven, Gradle: project.Gradle, Npm: project.Npm, Yarn: project.Yarn, Go: project.Go, Pip: project.Pip, Pipenv: project.Pipenv, Poetry: project.Poetry, Nuget: project.Nuget, Dotnet: project.Dotnet, Cocoapods: project.Cocoapods, Swift: project.Swift, Gem: project.Ruby, }
Associates a technology with project type (used in config commands for the package-managers). Docker is not present, as there is no docker-config command and, consequently, no docker.yaml file we need to operate on.
Functions ¶
func CdxPackageTypeToXrayPackageType ¶ added in v1.20.0
func ConvertXrayPackageType ¶ added in v1.18.0
func DetectTechnologiesDescriptors ¶
func DetectTechnologiesDescriptors(path string, recursive bool, requestedTechs []string, requestedDescriptors map[Technology][]string, excludePathPattern string) (technologiesDetected map[Technology]map[string][]string, err error)
If recursive is true, the search will not be limited to files in the root path. If recursive is true the search may return Technology.NoTech value If requestedTechs is empty, all technologies will be checked. If excludePathPattern is not empty, files/directories that match the wildcard pattern will be excluded from the search.
func DetectedTechnologiesList ¶
func DetectedTechnologiesList() (technologies []string)
func DetectedTechnologiesToSlice ¶
func DetectedTechnologiesToSlice(detected map[Technology]map[string][]string) []string
DetectedTechnologiesToSlice returns a string slice that includes all the names of the detected technologies.
func IsValidTechnology ¶ added in v1.20.0
func PurlToXrayComponentId ¶ added in v1.20.0
Extract the component name, version and type from PackageUrl and translate it to an Xray component id
func SplitComponentId ¶ added in v1.12.0
func SplitComponentIdRaw ¶ added in v1.18.0
SplitComponentIdRaw splits a Xray component ID to the component name, version and package type. In case componentId doesn't contain a version, the returned version will be an empty string. In case componentId's format is invalid, it will be returned as the component name and empty strings will be returned instead of the version and the package type. Examples:
- componentId: "gav://antparent:ant:1.6.5" Returned values: Component name: "antparent:ant" Component version: "1.6.5" Package type: "gav"
- componentId: "generic://sha256:244fd47e07d1004f0aed9c156aa09083c82bf8944eceb67c946ff7430510a77b/foo.jar" Returned values: Component name: "foo.jar" Component version: "" Package type: "generic"
- componentId: "invalid-comp-id" Returned values: Component name: "invalid-comp-id" Component version: "" Package type: ""
func SplitPackageURL ¶ added in v1.20.0
func SplitPackageUrlWithQualifiers ¶ added in v1.20.0
func SplitPackageUrlWithQualifiers(purl string) (packageType, compNamespace, compName, compVersion string, qualifiers map[string]string)
https://github.com/package-url/purl-spec/blob/main/PURL-SPECIFICATION.rst Parse a given Package URL (purl) and return the component namespace, name, version, and package type.
func ToCdxPackageType ¶ added in v1.20.0
func ToPackageRef ¶ added in v1.20.0
func ToPackageUrl ¶ added in v1.20.0
func ToXrayComponentId ¶ added in v1.18.0
func XrayComponentIdToCdxComponentRef ¶ added in v1.20.0
func XrayComponentIdToPurl ¶ added in v1.20.0
Types ¶
type CodeLanguage ¶
type CodeLanguage string
const ( JavaScript CodeLanguage = "javascript" Python CodeLanguage = "python" GoLang CodeLanguage = "go" Java CodeLanguage = "java" CSharp CodeLanguage = "C#" CPP CodeLanguage = "C++" Ruby CodeLanguage = "ruby" // CocoapodsLang package can have multiple languages CocoapodsLang CodeLanguage = "Any" SwiftLang CodeLanguage = "Any" )
func TechnologyToLanguage ¶
func TechnologyToLanguage(technology Technology) CodeLanguage
type ContentValidator ¶
Given a file content, returns true if the content is an indicator of the technology.
type Technology ¶
type Technology string
const ( Maven Technology = "maven" Gradle Technology = "gradle" Npm Technology = "npm" Pnpm Technology = "pnpm" Yarn Technology = "yarn" Go Technology = "go" Pip Technology = "pip" Pipenv Technology = "pipenv" Poetry Technology = "poetry" Nuget Technology = "nuget" Dotnet Technology = "dotnet" Docker Technology = "docker" Oci Technology = "oci" Conan Technology = "conan" Cocoapods Technology = "cocoapods" Swift Technology = "swift" NoTech Technology = "" Gem Technology = "ruby" )
func CdxPackageTypeToTechnology ¶ added in v1.20.0
func CdxPackageTypeToTechnology(cdxPackageType string) Technology
func GetAllTechnologiesList ¶
func GetAllTechnologiesList() (technologies []Technology)
func ToTechnologies ¶
func ToTechnologies(args []string) (technologies []Technology)
func ToTechnology ¶ added in v1.20.0
func ToTechnology(tech string) Technology
func (Technology) GetExecCommandName ¶
func (tech Technology) GetExecCommandName() string
func (Technology) GetPackageDescriptor ¶
func (tech Technology) GetPackageDescriptor() []string
func (Technology) GetPackageInstallationCommand ¶
func (tech Technology) GetPackageInstallationCommand() string
func (Technology) GetPackageType ¶
func (tech Technology) GetPackageType() string
func (Technology) GetPackageTypeId ¶ added in v1.12.0
func (tech Technology) GetPackageTypeId() string
func (Technology) GetPackageVersionOperator ¶
func (tech Technology) GetPackageVersionOperator() string
func (Technology) String ¶
func (tech Technology) String() string
func (Technology) ToFormal ¶
func (tech Technology) ToFormal() string