Documentation
¶
Index ¶
- func CreateMapOfFilteredFile(searchedFiles []types.SearchedFile, mapping *types.RegistryMapping) map[string]struct{}
- func FilterFilesByDate(files []types.File, filteredURIs map[string]struct{}) []types.File
- func FilterFilesByPatterns(files []types.File, includePatterns, excludePatterns []string) []types.File
- func FilterFilesByPatternsPackageName(packages []types.Package, includePatterns, excludePatterns []string) []types.Package
- func GenOCIImagePath(host string, pathParams ...string) string
- func GetChartFileName(name, version string) string
- func GetChartProvFileName(name, version string) string
- func GetPyPIVersion(filename string) string
- func GetRegistryRef(account string, ref string, registry string) string
- func GetSkipPrinter() *pterm.PrefixPrinter
- func IsFileLevelFilterableArtifact(artifactType types.ArtifactType) bool
- func IsHelmChartArchive(name string) bool
- func IsPackageLevelFilterableArtifact(artifactType types.ArtifactType) bool
- func IsTimeBasedFilterPresent(mapping *types.RegistryMapping) bool
- func IsWildCardExpression(pattern string) (bool, error)
- func MatchesPattern(filePath string, patterns []string) bool
- func MatchesWildCardPattern(packageName string, pattern string) bool
- func ParseChartFileName(filename string) (name, version string, ok bool)
- func ParseNugetFileNameWithPath(filePath string) (string, string, bool)
- func ParseNugetFileNameWithPath_old(filePath string) (string, string, bool)
- func ParsePuppetFileNameWithPath(filePath string) (string, string, bool)
- func ValidateDateFilter(df *types.DateFilter) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateMapOfFilteredFile ¶ added in v1.3.27
func CreateMapOfFilteredFile(searchedFiles []types.SearchedFile, mapping *types.RegistryMapping) map[string]struct{}
func FilterFilesByDate ¶ added in v1.3.26
func FilterFilesByPatterns ¶ added in v1.3.3
func FilterFilesByPatternsPackageName ¶ added in v1.3.3
func FilterFilesByPatternsPackageName(packages []types.Package, includePatterns, excludePatterns []string) []types.Package
This is to filter based on package name
func GenOCIImagePath ¶
func GetChartFileName ¶ added in v1.3.23
GetChartFileName returns the canonical chart archive file name for a given chart name and version: "<name>-<version>.tgz".
name may carry a nested directory prefix (e.g. "ChartA/ChartB/abc") produced by the JFrog adapter's getNestedName; the prefix is preserved verbatim so the upload path mirrors the source layout. The "<leaf>-<version>.tgz" form is what the server re-parses (it strips the prefix and validates the leaf against Chart.yaml).
func GetChartProvFileName ¶ added in v1.3.23
GetChartProvFileName returns the provenance sidecar file name for a chart: "<name>-<version>.tgz.prov".
func GetPyPIVersion ¶
func GetSkipPrinter ¶
func GetSkipPrinter() *pterm.PrefixPrinter
func IsFileLevelFilterableArtifact ¶ added in v1.3.3
func IsFileLevelFilterableArtifact(artifactType types.ArtifactType) bool
func IsHelmChartArchive ¶ added in v1.3.23
IsHelmChartArchive reports whether a file name is a Helm chart archive (".tgz") and not a provenance sidecar (".tgz.prov"). Used by the tree-sweep enumeration to select chart files while excluding their .prov siblings, checksum files, and the index.yaml itself.
func IsPackageLevelFilterableArtifact ¶ added in v1.3.3
func IsPackageLevelFilterableArtifact(artifactType types.ArtifactType) bool
func IsTimeBasedFilterPresent ¶ added in v1.3.26
func IsTimeBasedFilterPresent(mapping *types.RegistryMapping) bool
func IsWildCardExpression ¶ added in v1.3.18
func MatchesPattern ¶ added in v1.3.3
func MatchesWildCardPattern ¶ added in v1.3.18
support * and ?
func ParseChartFileName ¶ added in v1.3.23
ParseChartFileName splits a Helm chart file name like "{name}-{version}.tgz" (or "{name}-{version}.tgz.prov") into its name and version components.
This is a client-side port of HAR's server-side parser (artifact-registry: registry/pkg/helmhttp/helper.go ParseChartFileName) and MUST stay behaviourally identical, since the server re-parses the uploaded file name and rejects mismatches. The boundary between name and version is found by trying each hyphen left-to-right and accepting the first split whose right-hand side is a valid SemVer 2 string. This correctly handles both hyphenated chart names (e.g. "prometheus-mysql-exporter") and hyphenated prerelease versions (e.g. "1.21.0-alpha.1"), which a naive last-hyphen split would mis-parse.
Only the leaf segment is parsed: any directory prefix (e.g. "ChartA/ChartB/abc-1.0.1.tgz") is stripped first via path.Base, mirroring the server which derives the chart name from path.Base(filePath). ok is false when the name does not conform to the "<name>-<semver>" convention.
func ParseNugetFileNameWithPath ¶ added in v1.3.15
This will parse Nuget file with filePath like /package.version.nupkg or file name package.version.nupkg and return package , version and success , traversing from right side fo file name
func ParseNugetFileNameWithPath_old ¶ added in v1.3.15
This will parse Nuget file with filePath like /package.version.nupkg or file name package.version.nupkg and return package , version and success . this isplit logic using dot
func ParsePuppetFileNameWithPath ¶ added in v1.3.20
ParsePuppetFileNameWithPath parses a Puppet module tarball filename of the form "<author>-<module>-<version>.tar.gz" and returns the module name ("<author>-<module>") plus version. Module names contain a single hyphen and versions are valid SemVer 2.0.0 strings, so the version is found by scanning hyphen positions left-to-right and accepting the first split where both sides match their respective patterns.
func ValidateDateFilter ¶ added in v1.3.27
func ValidateDateFilter(df *types.DateFilter) error
Types ¶
This section is empty.