Documentation
¶
Index ¶
- func ChecksumBytes(content []byte, checkSumType constant.ChecksumType) (string, error)
- func ChecksumFile(filename string, checkSumType constant.ChecksumType) (string, error)
- func CompressFileToZstd(inputPath, outputPath string) error
- func CompressXMLToZstd(xmlData []byte, outputPath string) error
- func Contains(slice []string, elem string) bool
- func CopyDir(src string, dst string) error
- func CopyFile(src, dst string) error
- func CrCompareDependencyRegex(dep1, dep2 string) int
- func CrFlagToStr(flags uint64) string
- func CrIsPrimary(filePath string) bool
- func DependencyListContainsForbiddenControlChars(dep []model.Dependency) bool
- func DumpXML(obj any) ([]byte, error)
- func GetFilelistsPackage(pkg *model.Package, isFilelistsExt bool, taskID int64) *model.FilelistsPackage
- func GetOtherPackage(pkg *model.Package, taskID int64) *model.OtherPackage
- func GetPrimaryPackage(pkg *model.Package, taskID int64) *model.PrimaryPackage
- func HasControlChars(str string) bool
- func InitXMLStructAll() *model.XMLStructAll
- func IsDir(path string) bool
- func NormalizeDirPath(path string) string
- func PackageContainsForbiddenControlChars(pkg *model.Package) bool
- func PackageNEVRA(pkg *model.Package) string
- func PathExists(path string) (bool, error)
- func PrependProtocol(url string) string
- func RecordCmp(a, b *model.RepomdRecord) int
- func RecordTypeValue(recordType constant.RepomdType) int
- func ReverseArray[T any](slice []T)
- func StatFile(fullPath string) (int64, int64, error)
- func StrToEVR(input string) *model.EVR
- func WriteXML(obj any, filepath string) error
- func XMLDumpFiles(files []model.PackageFile, isPrimary bool, isFilelistsExt bool) []*model.File
- func XMLDumpPrimaryDumpPCOR(dependencies []model.Dependency, depType constant.DepType) *model.DepEntryList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChecksumBytes ¶
func ChecksumBytes(content []byte, checkSumType constant.ChecksumType) (string, error)
func ChecksumFile ¶
func ChecksumFile(filename string, checkSumType constant.ChecksumType) (string, error)
ChecksumFile return checksum of the filename according to the checkSumType
func CompressFileToZstd ¶
func CompressXMLToZstd ¶
func CrCompareDependencyRegex ¶
CrCompareDependencyRegex
Compares two dependency by name * NOTE: The function assume first parts must be same! * libc.so.6() < libc.so.6(GLIBC_2.3.4)(64 bit) < libc.so.6(GLIBC_2.4) * Returns -1 if first < second, 1 if first > second, and 0 if first == second.
func CrFlagToStr ¶
CrFlagToStr Convert flags from RPM header to a string representation.
func CrIsPrimary ¶
CrIsPrimary Check if the filename match pattern for primary files (files listed in primary.xml).
func DependencyListContainsForbiddenControlChars ¶
func DependencyListContainsForbiddenControlChars(dep []model.Dependency) bool
DependencyListContainsForbiddenControlChars check if the name, epoch, version, and release in the list of dependencies contain any forbidden control characters.
func GetFilelistsPackage ¶
func GetOtherPackage ¶
func GetOtherPackage(pkg *model.Package, taskID int64) *model.OtherPackage
func GetPrimaryPackage ¶
func GetPrimaryPackage(pkg *model.Package, taskID int64) *model.PrimaryPackage
func HasControlChars ¶
HasControlChars checks if a string contains control characters other than tab (9), newline (10), and carriage return (13).
func InitXMLStructAll ¶
func InitXMLStructAll() *model.XMLStructAll
func NormalizeDirPath ¶
NormalizeDirPath Return path with exactly one trailing '/'
func PackageNEVRA ¶
func PrependProtocol ¶
PrependProtocol checks if the given URL starts with a forward slash and, if so, prepends "file://" to it. Otherwise, it returns the URL as is.
func RecordCmp ¶
func RecordCmp(a, b *model.RepomdRecord) int
RecordCmp compares two crRepomdRecord pointers and returns an integer for sorting purposes.
func RecordTypeValue ¶
func RecordTypeValue(recordType constant.RepomdType) int
func ReverseArray ¶
func ReverseArray[T any](slice []T)
func XMLDumpFiles ¶
func XMLDumpPrimaryDumpPCOR ¶
func XMLDumpPrimaryDumpPCOR(dependencies []model.Dependency, depType constant.DepType) *model.DepEntryList
Types ¶
This section is empty.