Documentation
¶
Index ¶
- Constants
- 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 GetConanPackages(files []*types.File, registry string) []types.Package
- func GetPyPIVersion(filename string) string
- func GetRegistryRef(account string, ref string, registry string) string
- func GetSkipPrinter() *pterm.PrefixPrinter
- func IsConanPackageFile(name string) bool
- func IsConanRecipeFile(name string) bool
- 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
- type ConanFileEntry
- type ConanLayer
- type ConanRef
Constants ¶
const ( ConanPlaceholder = "_" ConanManifestFile = "conanmanifest.txt" ConanFilePy = "conanfile.py" ConanInfoTxt = "conaninfo.txt" // Tarball prefixes; each may appear at most once per revision, in any one of // the allowed compression variants. ConanTarballExport = "conan_export" ConanTarballSources = "conan_sources" ConanTarballPackage = "conan_package" )
Conan v2 JFrog storage layout (repo-relative Uri):
.../{name}/{version}/{user}/{channel}/{rrev}/export/{file} -> recipe layer
.../{name}/{version}/{user}/{channel}/{rrev}/package/{pkgid}/{prev}/{file} -> package layer
The reference coordinates are located relative to the "export"/"package" layer marker rather than a fixed offset, so any leading prefix some layouts use (e.g. a "_" root segment) is ignored. "_" is the placeholder JFrog uses for an absent user/channel.
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 GetConanPackages ¶ added in v1.3.29
GetConanPackages returns one package per distinct Conan reference found in the file list. Each package's Path is the reference subtree so the package job's tree node scopes to just that reference's files.
func GetPyPIVersion ¶
func GetSkipPrinter ¶
func GetSkipPrinter() *pterm.PrefixPrinter
func IsConanPackageFile ¶ added in v1.3.29
IsConanPackageFile reports whether name is a canonical package-layer file, mirroring the destination server's package filename rule.
func IsConanRecipeFile ¶ added in v1.3.29
IsConanRecipeFile reports whether name is a canonical recipe-layer file, mirroring the destination server's recipe filename rule.
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 ¶
type ConanFileEntry ¶ added in v1.3.29
type ConanFileEntry struct {
Reference ConanRef
Layer ConanLayer
RRev string
PkgID string
PRev string
FileName string
Uri string
SHA1 string
Size int
}
ConanFileEntry is a single migratable Conan file with the coordinates needed to re-upload it to the destination (recipe or package layer).
func ParseConanEntries ¶ added in v1.3.29
func ParseConanEntries(files []*types.File) []ConanFileEntry
ParseConanEntries converts a reference's files into upload-ready entries, ordered so every conanmanifest.txt is uploaded last within its layer/revision group (the finalization marker the server expects last).
func ParseConanFileURI ¶ added in v1.3.29
func ParseConanFileURI(uri string) (ConanFileEntry, bool)
ParseConanFileURI parses a repo-relative JFrog Conan v2 Uri into a ConanFileEntry. ok is false for paths that are not canonical Conan recipe or package files (e.g. JFrog-internal index/metadata files), so callers can skip anything the destination would reject.
type ConanLayer ¶ added in v1.3.29
type ConanLayer string
ConanLayer identifies whether a file belongs to the recipe (RREV) or package (PKGID/PREV) layer of a Conan reference.
const ( ConanLayerRecipe ConanLayer = "recipe" ConanLayerPackage ConanLayer = "package" )
type ConanRef ¶ added in v1.3.29
ConanRef holds the coordinates of a Conan reference (name/version[@user/channel]). User/Channel are "_" when absent, matching the on-disk placeholder.