package utils
import "github.com/spdx/tools-golang/utils"
Package utils contains various utility functions to support the main tools-golang packages. SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
Package utils contains various utility functions to support the main tools-golang packages. SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
Index ¶
- func GetAllFilePaths(dirRoot string, pathsIgnored []string) ([]string, error)
- func GetHashesForFilePath(p string) (string, string, string, error)
- func GetVerificationCode2_1(files map[spdx.ElementID]*spdx.File2_1, excludeFile string) (string, error)
- func GetVerificationCode2_2(files map[spdx.ElementID]*spdx.File2_2, excludeFile string) (string, error)
- func ShouldIgnore(fileName string, pathsIgnored []string) bool
Functions ¶
func GetAllFilePaths ¶
GetAllFilePaths takes a path to a directory (including an optional slice of path patterns to ignore), and returns a slice of relative paths to all files in that directory and its subdirectories (excluding those that are ignored).
func GetHashesForFilePath ¶
GetHashesForFilePath takes a path to a file on disk, and returns SHA1, SHA256 and MD5 hashes for that file as strings.
func GetVerificationCode2_1 ¶
func GetVerificationCode2_1(files map[spdx.ElementID]*spdx.File2_1, excludeFile string) (string, error)
GetVerificationCode2_1 takes a slice of files and an optional filename for an "excludes" file, and returns a Package Verification Code calculated according to SPDX spec version 2.1, section 3.9.4.
func GetVerificationCode2_2 ¶
func GetVerificationCode2_2(files map[spdx.ElementID]*spdx.File2_2, excludeFile string) (string, error)
GetVerificationCode2_2 takes a slice of files and an optional filename for an "excludes" file, and returns a Package Verification Code calculated according to SPDX spec version 2.2, section 3.9.4.
func ShouldIgnore ¶
ShouldIgnore compares a file path to a slice of file path patterns, and determines whether that file should be ignored because it matches any of those patterns.
Source Files ¶
- Version
- v0.1.0
- Published
- Mar 20, 2021
- Platform
- windows/amd64
- Imports
- 10 packages
- Last checked
- 6 seconds ago –
Tools for package owners.