File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -127,18 +127,21 @@ type LicenseCounters struct {
127127 Counter int `json:"counter,omitempty"`
128128}
129129
130+ // AgeCounters contains age counter information.
130131type AgeCounters struct {
131132 Age string `json:"age,omitempty"`
132133 Counter int `json:"counter,omitempty"`
133134 SeverityCounters []SeverityCounters `json:"severityCounters,omitempty"`
134135}
135136
137+ // PackageCounters contains package counter information.
136138type PackageCounters struct {
137139 PackageID string `json:"packageId,omitempty"`
138140 Counter int `json:"counter,omitempty"`
139141 IsMalicious bool `json:"isMalicious,omitempty"`
140142}
141143
144+ // SeverityStatusCounters contains combined severity and status counter information.
142145type SeverityStatusCounters struct {
143146 Severity string `json:"severity,omitempty"`
144147 Status string `json:"status,omitempty"`
Original file line number Diff line number Diff line change @@ -14,15 +14,18 @@ const (
1414 failedToParseScanSummary = "Failed to parse scan-summary response"
1515)
1616
17+ // ScanSummaryHTTPWrapper is a struct that implements the ScanSummaryWrapper interface for retrieving scan summaries via HTTP requests.
1718type ScanSummaryHTTPWrapper struct {
1819 path string
1920}
2021
22+ // NewHTTPScanSummaryWrapper creates a new instance of ScanSummaryHTTPWrapper with the provided path.
2123func NewHTTPScanSummaryWrapper (path string ) ScanSummaryWrapper {
2224 return & ScanSummaryHTTPWrapper {
2325 path : path ,
2426 }
2527}
28+ // GetScanSummaryByScanID retrieves the scan summary for a given scan ID by making an HTTP GET request to the configured path.
2629func (s * ScanSummaryHTTPWrapper ) GetScanSummaryByScanID (scanID string ) (* ScanSummariesModel , * WebError , error ) {
2730 clientTimeout := viper .GetUint (commonParams .ClientTimeoutKey )
2831 // Construct the path with query parameter
Original file line number Diff line number Diff line change 11package wrappers
22
3+ // ScanSummaryWrapper wraps scan summary logic.
34type ScanSummaryWrapper interface {
45 GetScanSummaryByScanID (scanID string ) (* ScanSummariesModel , * WebError , error )
56}
You can’t perform that action at this time.
0 commit comments