scanner

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 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(hostName string, 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

type Path

type Path int

type ScanClientInterface

type ScanClientInterface interface {
	Scan(job ScanJob) (*ScanClientJobResults, 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 {
	PullSpec              string
	Sha                   string
	HubProjectName        string
	HubProjectVersionName string
	HubScanName           string
}

func NewScanJob

func NewScanJob(pullSpec string, sha string, hubProjectName string, hubProjectVersionName string, hubScanName string) *ScanJob

func (ScanJob) DockerPullSpec added in v0.0.5

func (sj ScanJob) DockerPullSpec() string

func (ScanJob) DockerTarFilePath added in v0.0.5

func (sj ScanJob) DockerTarFilePath() string

Jump to

Keyboard shortcuts

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