Documentation ¶
Index ¶
- func Contains[E comparable](s []E, v E) bool
- func CreateSource(sourceType SourceType, localImage bool) string
- func GenerateHash(inputType SourceType, source string) (string, error)
- func GetVulnerabilityTotalsPerSeverity(vulnerabilities *[]apitypes.Vulnerability) *apitypes.VulnerabilitySeveritySummary
- func Index[E comparable](s []E, v E) int
- func PrintJSONData(data interface{}, fields string) error
- func RunCommand(cmd *exec.Cmd) ([]byte, error)
- func RunCommandAndParseOutputLineByLine(cmd *exec.Cmd, pfn, ecFn processFn) error
- func UnwrapErrorStrings(err error) []string
- func UnwrapErrors(err error) []error
- type CmdRunError
- type SourceType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
func Contains[E comparable](s []E, v E) bool
Contains reports whether v is present in s.
func CreateSource ¶
func CreateSource(sourceType SourceType, localImage bool) string
func GenerateHash ¶
func GenerateHash(inputType SourceType, source string) (string, error)
func GetVulnerabilityTotalsPerSeverity ¶
func GetVulnerabilityTotalsPerSeverity(vulnerabilities *[]apitypes.Vulnerability) *apitypes.VulnerabilitySeveritySummary
func Index ¶
func Index[E comparable](s []E, v E) int
Index returns the index of the first occurrence of v in s, or -1 if not present.
func PrintJSONData ¶
func UnwrapErrorStrings ¶
UnwrapErrorStrings returns a slice of error strings by unwrapping err error. Returned slice is nil if provider err is nil. Slice with the original err as a single element is returned if err does not implement `Unwrap() error` or `Unwrap []error` interfaces. UnwrapErrorStrings does not perform recursive lookup, so only the top level err is unwrapped.
func UnwrapErrors ¶
UnwrapErrors returns a slice of errors by unwrapping err error. Returned slice is nil if err is nil. Slice with the original err as a single element is returned if err does not implement `Unwrap() error` or `Unwrap []error` interfaces. UnwrapErrors does not perform recursive lookup, so only the top level err is unwrapped.
Types ¶
type CmdRunError ¶
func (CmdRunError) Error ¶
func (r CmdRunError) Error() string
type SourceType ¶
type SourceType string
const ( SBOM SourceType = "sbom" IMAGE SourceType = "image" DOCKERARCHIVE SourceType = "docker-archive" OCIARCHIVE SourceType = "oci-archive" OCIDIR SourceType = "oci-dir" DIR SourceType = "dir" ROOTFS SourceType = "rootfs" FILE SourceType = "file" )