Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CodeLocation ¶
type Fetcher ¶
type Fetcher struct {
// contains filtered or unexported fields
}
func NewFetcher ¶
NewFetcher returns a new, logged-in Fetcher. It will instead return an error if either of the following happen:
- unable to instantiate an API client
- unable to sign in to the Hub
func (*Fetcher) FetchProjectByName ¶
FetchProjectByName searches for a project with the matching name,
returning a populated Project model
func (*Fetcher) FetchScanFromImage ¶
FetchScanFromImage returns an ImageScan only if: - it can find a project with the matching name, with - a project version with the matching name, with - one code location, with - one scan summary, with - a completed status
type FetcherInterface ¶
type ImageScan ¶
type ImageScan struct {
RiskProfile RiskProfile
PolicyStatus PolicyStatus
ScanSummary ScanSummary
CodeLocationCreatedAt string
CodeLocationMappedProjectVersion string
CodeLocationName string
CodeLocationType string
CodeLocationURL string
CodeLocationUpdatedAt string
}
ImageScan models the results that we expect to get from the hub after scanning a docker image.
func (*ImageScan) IsDone ¶
IsDone returns whether the hub imagescan results indicate that the scan is complete.
func (*ImageScan) OverallStatus ¶
func (*ImageScan) PolicyViolationCount ¶
func (*ImageScan) VulnerabilityCount ¶
type MockHub ¶
type MockHub struct {
// contains filtered or unexported fields
}
MockHub is a mock implementation of ScanClientInterface .
func NewMockHub ¶
func NewMockHub() *MockHub
func (*MockHub) FetchProjectByName ¶
type PolicyStatus ¶
type PolicyStatus struct {
OverallStatus string
UpdatedAt string
ComponentVersionStatusCounts map[string]int
}
func (*PolicyStatus) ViolationCount ¶
func (ps *PolicyStatus) ViolationCount() int
type RiskProfile ¶
func (*RiskProfile) HighRiskVulnerabilityCount ¶
func (rp *RiskProfile) HighRiskVulnerabilityCount() int
type ScanSummary ¶
type Version ¶
type Version struct {
CodeLocations []CodeLocation
RiskProfile RiskProfile
PolicyStatus PolicyStatus
Distribution string
Nickname string
VersionName string
ReleasedOn string
ReleaseComments string
Phase string
}