scanner

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PathGetNextImage    = iota
	PathPostScanResults = iota
)
View Source
const (
	ErrorTypeUnableToPullDockerImage = iota
	ErrorTypeFailedToRunJavaScanner  = iota
)

Variables

This section is empty.

Functions

func ScannerMetricsHandler

func ScannerMetricsHandler(imageScanStats <-chan ScanClientJobResults, httpStats <-chan HttpResult) http.Handler

ScannerMetricsHandler handles http requests to get prometheus metrics for image scanning

Types

type ErrorType

type ErrorType int

func (ErrorType) String

func (et ErrorType) String() string

type HttpResult

type HttpResult struct {
	StatusCode int
	Path       Path
}

type HubScanClient

type HubScanClient struct {
	// contains filtered or unexported fields
}

HubScanClient implements ScanClientInterface using the Black Duck hub and scan client programs.

func NewHubScanClient

func NewHubScanClient(host string, username string, password string) (*HubScanClient, error)

NewHubScanClient requires login credentials in order to instantiate a HubScanClient.

func (*HubScanClient) Scan

func (*HubScanClient) ScanCliSh

func (hsc *HubScanClient) ScanCliSh(job ScanJob) error

func (*HubScanClient) ScanDockerSh

func (hsc *HubScanClient) ScanDockerSh(job ScanJob) error

type Path

type Path int

type ScanClientInterface

type ScanClientInterface interface {
	Scan(job ScanJob) (*ScanClientJobResults, error)
	ScanCliSh(job ScanJob) error
	ScanDockerSh(job ScanJob) error
}

type ScanClientJobResults

type ScanClientJobResults struct {
	DockerStats        docker.ImagePullStats
	ScanClientDuration *time.Duration
	TotalDuration      *time.Duration
	Err                *ScanError
}

type ScanError

type ScanError struct {
	Code      ErrorType
	RootCause error
}

func (ScanError) Error

func (se ScanError) Error() string

func (*ScanError) String

func (se *ScanError) String() string

type ScanJob

type ScanJob struct {
	Image common.Image
}

func NewScanJob

func NewScanJob(image common.Image) *ScanJob

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL