Documentation ¶
Overview ¶
Package utils provides utility fns for UDS-CLI
Package utils provides utility fns for UDS-CLI
Index ¶
- func CheckYAMLSourcePath(source string) error
- func ConfigureLogs(cmd *cobra.Command) error
- func ExtractJSON(j any) func(context.Context, av4.File) error
- func HandleSBOM(extractSBOM bool, SBOMArtifactPathMap map[string]string, ...) ([]string, error)
- func IncludeComponent(componentToCheck string, filteredComponents []v1alpha1.ZarfComponent) bool
- func IsRegistryURL(s string) bool
- func IsRemotePkg(pkg types.Package) bool
- func IsValidTarballPath(path string) bool
- func JSONValue(value any) (string, error)
- func ReadYAMLStrict(path string, destConfig any) error
- func SBOMExtractor(dst string, SBOMArtifactPathMap map[string]string) func(_ context.Context, f archiver.File) error
- func ToLocalFile(t any, filePath string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckYAMLSourcePath ¶ added in v0.11.1
CheckYAMLSourcePath checks if the provided YAML source path is valid
func ConfigureLogs ¶ added in v0.10.0
ConfigureLogs sets up the log file, log cache and output for the CLI
func ExtractJSON ¶
ExtractJSON extracts and unmarshals a tarballed JSON file into a type
func HandleSBOM ¶ added in v0.16.0
func HandleSBOM(extractSBOM bool, SBOMArtifactPathMap map[string]string, bundleName, dstPath string) ([]string, error)
HandleSBOM handles the extraction and creation of bundle SBOMs after populating SBOMArtifactPathMap
func IncludeComponent ¶ added in v0.11.0
func IncludeComponent(componentToCheck string, filteredComponents []v1alpha1.ZarfComponent) bool
IncludeComponent checks if a component has been specified in a a list of components (used for filtering optional components)
func IsRegistryURL ¶ added in v0.10.4
IsRegistryURL checks if a string is a URL
func IsRemotePkg ¶
IsRemotePkg returns true if the Zarf package is remote
func IsValidTarballPath ¶
IsValidTarballPath returns true if the path is a valid tarball path to a bundle tarball
func ReadYAMLStrict ¶ added in v0.11.0
ReadYAMLStrict reads a YAML file into a struct, with strict parsing
func SBOMExtractor ¶
func SBOMExtractor(dst string, SBOMArtifactPathMap map[string]string) func(_ context.Context, f archiver.File) error
SBOMExtractor is the extraction fn for extracting HTML and JSON files from an sboms.tar archive
func ToLocalFile ¶
ToLocalFile takes an arbitrary type, typically a struct, marshals it into JSON and stores it as a local file
Types ¶
This section is empty.