Documentation ¶
Index ¶
- func IsLegalTransition(from ScanStatus, to ScanStatus) bool
- type Container
- type DockerImageSha
- type HubImageScan
- type Image
- type ImageInfo
- func (imageInfo *ImageInfo) AddRepoTag(repoTag *RepoTag)
- func (imageInfo *ImageInfo) FirstRepoTag() *RepoTag
- func (imageInfo *ImageInfo) Image() Image
- func (imageInfo *ImageInfo) SetPriority(priority int)
- func (imageInfo *ImageInfo) SetScanResults(results *hub.ScanResults)
- func (imageInfo *ImageInfo) TimeInCurrentScanStatus() time.Duration
- type ImageTransition
- type Metrics
- type Model
- func (model *Model) AddImage(image Image)
- func (model *Model) AddPod(pod Pod)
- func (model *Model) DeletePod(podName string)
- func (model *Model) FinishScanJob(image *Image, err error)
- func (model *Model) GetImages(status ScanStatus) []DockerImageSha
- func (model *Model) GetMetrics() *Metrics
- func (model *Model) GetModel() *api.CoreModel
- func (model *Model) GetNextImage() *Image
- func (model *Model) GetScanResults() api.ScanResults
- func (model *Model) ScanDidFinish(sha DockerImageSha, scanResults *hub.ScanResults)
- func (model *Model) SetImages(images []Image)
- func (model *Model) SetPods(pods []Pod)
- func (model *Model) StartScanClient(sha DockerImageSha) error
- func (model *Model) UpdatePod(pod Pod)
- type Pod
- type RepoTag
- type Scan
- type ScanStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsLegalTransition ¶ added in v0.0.15
func IsLegalTransition(from ScanStatus, to ScanStatus) bool
IsLegalTransition .....
Types ¶
type DockerImageSha ¶
type DockerImageSha string
DockerImageSha .....
func NewDockerImageSha ¶
func NewDockerImageSha(sha string) (DockerImageSha, error)
NewDockerImageSha ensures that the sha is 64 characters.
type HubImageScan ¶
type HubImageScan struct { Sha DockerImageSha Scan *hub.ScanResults Err error }
HubImageScan .....
type Image ¶
type Image struct { Repository string Tag string Sha DockerImageSha Priority int BlackDuckProjectName string BlackDuckProjectVersion string }
Image stores the Image configuration
func NewImage ¶
func NewImage(repository string, tag string, sha DockerImageSha, priority int, blackDuckProjectName string, blackDuckProjectVersion string) *Image
NewImage returns the image congifurations
func (Image) GetBlackDuckProjectName ¶
GetBlackDuckProjectName returns the Black Duck project name
func (Image) GetBlackDuckProjectVersionName ¶
GetBlackDuckProjectVersionName returns the Black Duck project version name
func (Image) GetBlackDuckScanName ¶
GetBlackDuckScanName returns the Black Duck scan name
type ImageInfo ¶
type ImageInfo struct { ScanStatus ScanStatus TimeOfLastStatusChange time.Time TimeOfLastRefresh time.Time ScanResults *hub.ScanResults ImageSha DockerImageSha RepoTags []*RepoTag Priority int BlackDuckProjectName string BlackDuckProjectVersion string }
ImageInfo .....
func (*ImageInfo) AddRepoTag ¶
AddRepoTag .....
func (*ImageInfo) FirstRepoTag ¶
FirstRepoTag .....
func (*ImageInfo) SetPriority ¶
SetPriority ...
func (*ImageInfo) SetScanResults ¶
func (imageInfo *ImageInfo) SetScanResults(results *hub.ScanResults)
SetScanResults .....
func (*ImageInfo) TimeInCurrentScanStatus ¶
TimeInCurrentScanStatus .....
type ImageTransition ¶
type ImageTransition struct { Sha DockerImageSha From string To ScanStatus Err error Time time.Time }
ImageTransition .....
func NewImageTransition ¶
func NewImageTransition(sha DockerImageSha, from string, to ScanStatus, err error) *ImageTransition
NewImageTransition .....
type Metrics ¶
type Metrics struct { ScanStatusCounts map[ScanStatus]int NumberOfPods int NumberOfImages int ContainerCounts map[int]int ImageCountHistogram map[int]int PodStatus map[string]int ImageStatus map[string]int PodPolicyViolations map[int]int ImagePolicyViolations map[int]int PodVulnerabilities map[int]int ImageVulnerabilities map[int]int }
Metrics .....
type Model ¶
type Model struct { // Pods is a map of qualified name ("<namespace>/<name>") to pod Pods map[string]Pod Images map[DockerImageSha]*ImageInfo ImageScanQueue *util.PriorityQueue ImageTransitions []*ImageTransition // contains filtered or unexported fields }
Model is the root of the core model
func (*Model) FinishScanJob ¶
FinishScanJob should be called when the scan client has finished.
func (*Model) GetImages ¶
func (model *Model) GetImages(status ScanStatus) []DockerImageSha
GetImages returns images in that status
func (*Model) GetMetrics ¶
GetMetrics calculates useful metrics for observing the progress of the model over time.
func (*Model) GetScanResults ¶
func (model *Model) GetScanResults() api.ScanResults
GetScanResults ...
func (*Model) ScanDidFinish ¶
func (model *Model) ScanDidFinish(sha DockerImageSha, scanResults *hub.ScanResults)
ScanDidFinish should be called when: - the Hub scan finishes - upon startup, when scan results are first fetched
func (*Model) StartScanClient ¶
func (model *Model) StartScanClient(sha DockerImageSha) error
StartScanClient ...
type Scan ¶
Scan denotes the status of the scan with vulnerability and policy violation of the status
type ScanStatus ¶
type ScanStatus int
ScanStatus describes the state of an image in perceptor
const ( ScanStatusUnknown ScanStatus = iota ScanStatusInQueue ScanStatus = iota ScanStatusRunningScanClient ScanStatus = iota ScanStatusRunningHubScan ScanStatus = iota ScanStatusComplete ScanStatus = iota )
.....
func (ScanStatus) MarshalJSON ¶
func (status ScanStatus) MarshalJSON() ([]byte, error)
MarshalJSON .....
func (ScanStatus) MarshalText ¶
func (status ScanStatus) MarshalText() (text []byte, err error)
MarshalText .....