Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandExecutor ¶
type CommandExecutor interface { // ExecuteCommand executes a command with the given name, arguments, and environment variables. // It returns the standard output, standard error, and any error that occurred during execution. ExecuteCommand(name string, args []string, env []string) (stdout string, stderr string, err error) }
CommandExecutor is an interface for executing commands.
type HTTPClientInterface ¶
HTTPClientInterface is an abstraction that allows for easier testing by mocking HTTP responses. It defines a single method, Do, which takes an http.Request and returns an http.Response and an error.
type Logger ¶
type Logger interface { // Debug logs a debug message with the given fields. Debug(msg string, fields ...interface{}) // Info logs an info message with the given fields. Info(msg string, fields ...interface{}) // Warn logs a warn message with the given fields. Warn(msg string, fields ...interface{}) // Error logs an error message with the given fields. Error(msg string, fields ...interface{}) // Fatalf logs a fatal message with the given fields. Fatalf(msg string, fields ...interface{}) }
Logger is the interface that the logger must implement.
type RealHTTPClient ¶
RealHTTPClient is a concrete implementation of HTTPClientInterface that uses a real http.Client to make requests.
func NewRealHTTPClient ¶
func NewRealHTTPClient() *RealHTTPClient
NewRealHTTPClient creates a new instance of RealHTTPClient with a default http.Client. The http.Client can be customized as needed, for example, by setting timeouts.
type ScanResult ¶
type ScanResult struct { ArtifactName string `json:"ArtifactName"` Results []struct { Vulnerabilities []VulnerabilityInfo `json:"Vulnerabilities"` } `json:"Results"` }
ScanResult represents the result of scanning an artifact for vulnerabilities.
type ScanResultReader ¶
type ScanResultReader interface { // GetArtifactName returns the name of the scanned artifact. GetArtifactName() string // GetVulnerabilities returns a slice of VulnerabilityInfo representing the vulnerabilities // found in the scanned artifact. GetVulnerabilities() []VulnerabilityInfo // GetResultsAsCSV returns the scan results in CSV format. GetResultsAsCSV() string }
ScanResultReader is an interface for reading scan results.
type VulnerabilityInfo ¶
type VulnerabilityInfo struct { VulnerabilityID string `json:"VulnerabilityID"` PkgName string `json:"PkgName"` InstalledVersion string `json:"InstalledVersion"` FixedVersion string `json:"FixedVersion"` Severity string `json:"Severity"` Description string `json:"Description"` }
VulnerabilityInfo represents information about a vulnerability found in a scanned artifact.