Documentation
¶
Index ¶
- Constants
- func SetupHTTPServer(responder Responder)
- type AllImages
- type AllPods
- type Container
- type CoreModel
- type FinishedScanClientJob
- type Image
- type ImageInfo
- type ImageSpec
- type MockResponder
- func (mr *MockResponder) AddImage(image Image) error
- func (mr *MockResponder) AddPod(pod Pod) error
- func (mr *MockResponder) DeletePod(qualifiedName string)
- func (mr *MockResponder) Error(w http.ResponseWriter, r *http.Request, err error, statusCode int)
- func (mr *MockResponder) GetModel() (*Model, error)
- func (mr *MockResponder) GetNextImage() NextImage
- func (mr *MockResponder) GetScanResults() ScanResults
- func (mr *MockResponder) NotFound(w http.ResponseWriter, r *http.Request)
- func (mr *MockResponder) PostCommand(command *PostCommand)
- func (mr *MockResponder) PostFinishScan(job FinishedScanClientJob) error
- func (mr *MockResponder) UpdateAllImages(allImages AllImages) error
- func (mr *MockResponder) UpdateAllPods(allPods AllPods) error
- func (mr *MockResponder) UpdatePod(pod Pod) error
- type Model
- type ModelBlackDuck
- type ModelBlackDuckConfig
- type ModelCircuitBreaker
- type ModelCodeLocation
- type ModelConfig
- type ModelHost
- type ModelImageInfo
- type ModelImageTransition
- type ModelRepoTag
- type ModelScanScheduler
- type ModelTime
- type ModelTimings
- type NextImage
- type Pod
- type PostCommand
- type Responder
- type ScanResults
- type ScannedImage
- type ScannedPod
Constants ¶
const ( // perceptor-scanner paths NextImagePath = "nextimage" FinishedScanPath = "finishedscan" // perceiver paths PodPath = "pod" ImagePath = "image" ScanResultsPath = "scanresults" AllImagesPath = "allimages" AllPodsPath = "allpods" // Internal ConcurrentScanLimitPath = "concurrentscanlimit" )
Three things that should work: curl -X GET http://perceptor.bds-perceptor.svc.cluster.local:3001/metrics curl -X GET http://perceptor.bds-perceptor:3001/metrics curl -X GET http://perceptor:3001/metrics
Variables ¶
This section is empty.
Functions ¶
func SetupHTTPServer ¶
func SetupHTTPServer(responder Responder)
SetupHTTPServer will setup all api's to be served
Types ¶
type Container ¶ added in v0.0.3
Container .....
func NewContainer ¶ added in v0.0.3
NewContainer .....
type CoreModel ¶
type CoreModel struct {
Pods map[string]*Pod
Images map[string]*ModelImageInfo
ImageScanQueue []map[string]interface{}
ImageTransitions []*ModelImageTransition
}
CoreModel .....
type FinishedScanClientJob ¶
FinishedScanClientJob stores the scan client job finished status
type Image ¶
type Image struct {
Repository string
Tag string
Sha string
Priority *int
BlackDuckProjectName string
BlackDuckProjectVersion string
}
Image .....
type ImageInfo ¶ added in v0.0.10
type ImageInfo struct {
Image Image
PolicyViolations int
Vulnerabilities int
OverallStatus string
ComponentsURL string
}
ImageInfo .....
type ImageSpec ¶ added in v0.0.5
type ImageSpec struct {
Repository string
Tag string
Sha string
Scheme string
Domain string
Port int
User string
Password string
BlackDuckProjectName string
BlackDuckProjectVersionName string
BlackDuckScanName string
Priority int
}
ImageSpec stores the Image specification
type MockResponder ¶ added in v0.0.10
MockResponder .....
func NewMockResponder ¶ added in v0.0.10
func NewMockResponder() *MockResponder
NewMockResponder .....
func (*MockResponder) AddImage ¶ added in v0.0.10
func (mr *MockResponder) AddImage(image Image) error
AddImage .....
func (*MockResponder) AddPod ¶ added in v0.0.10
func (mr *MockResponder) AddPod(pod Pod) error
AddPod .....
func (*MockResponder) DeletePod ¶ added in v0.0.10
func (mr *MockResponder) DeletePod(qualifiedName string)
DeletePod .....
func (*MockResponder) Error ¶ added in v0.0.10
func (mr *MockResponder) Error(w http.ResponseWriter, r *http.Request, err error, statusCode int)
Error .....
func (*MockResponder) GetModel ¶ added in v0.0.10
func (mr *MockResponder) GetModel() (*Model, error)
GetModel .....
func (*MockResponder) GetNextImage ¶ added in v0.0.10
func (mr *MockResponder) GetNextImage() NextImage
GetNextImage .....
func (*MockResponder) GetScanResults ¶ added in v0.0.10
func (mr *MockResponder) GetScanResults() ScanResults
GetScanResults .....
func (*MockResponder) NotFound ¶ added in v0.0.10
func (mr *MockResponder) NotFound(w http.ResponseWriter, r *http.Request)
NotFound .....
func (*MockResponder) PostCommand ¶
func (mr *MockResponder) PostCommand(command *PostCommand)
PostCommand ...
func (*MockResponder) PostFinishScan ¶ added in v0.0.10
func (mr *MockResponder) PostFinishScan(job FinishedScanClientJob) error
PostFinishScan .....
func (*MockResponder) UpdateAllImages ¶ added in v0.0.10
func (mr *MockResponder) UpdateAllImages(allImages AllImages) error
UpdateAllImages .....
func (*MockResponder) UpdateAllPods ¶ added in v0.0.10
func (mr *MockResponder) UpdateAllPods(allPods AllPods) error
UpdateAllPods .....
func (*MockResponder) UpdatePod ¶ added in v0.0.10
func (mr *MockResponder) UpdatePod(pod Pod) error
UpdatePod .....
type Model ¶ added in v0.0.17
type Model struct {
BlackDucks map[string]*ModelBlackDuck
CoreModel *CoreModel
Config *ModelConfig
Scheduler *ModelScanScheduler
}
Model stores the perceptor model
type ModelBlackDuck ¶
type ModelBlackDuck struct {
// can we log in to the Black Duck?
// IsLoggedIn bool
// have all the projects been sucked in?
HasLoadedAllCodeLocations bool
// map of project name to ... ? Black Duck URL?
// Projects map[string]string
// map of code location name to mapped project version url
CodeLocations map[string]*ModelCodeLocation
Errors []string
Status string
CircuitBreaker *ModelCircuitBreaker
Host string
}
ModelBlackDuck describes a Black Duck client model
type ModelBlackDuckConfig ¶
type ModelBlackDuckConfig struct {
Hosts []*ModelHost
ClientTimeout ModelTime
TLSVerification bool
}
ModelBlackDuckConfig ...
type ModelCircuitBreaker ¶
type ModelCircuitBreaker struct {
State string
NextCheckTime *time.Time
MaxBackoffDuration ModelTime
ConsecutiveFailures int
}
ModelCircuitBreaker ...
type ModelCodeLocation ¶
type ModelCodeLocation struct {
Stage string
Href string
URL string
MappedProjectVersion string
UpdatedAt string
ComponentsHref string
}
ModelCodeLocation ...
type ModelConfig ¶ added in v0.0.17
type ModelConfig struct {
Timings *ModelTimings
BlackDuck *ModelBlackDuckConfig
Port int
LogLevel string
}
ModelConfig .....
type ModelHost ¶
type ModelHost struct {
Scheme string
Domain string // it can be domain name or ip address
Port int
User string
ConcurrentScanLimit int
}
ModelHost ...
type ModelImageInfo ¶ added in v0.0.17
type ModelImageInfo struct {
ScanStatus string
TimeOfLastStatusChange string
ScanResults interface{}
ImageSha string
RepoTags []*ModelRepoTag
Priority int
}
ModelImageInfo .....
type ModelImageTransition ¶
ModelImageTransition .....
type ModelTime ¶
type ModelTime struct {
Minutes float64
Seconds float64
Milliseconds float64
// contains filtered or unexported fields
}
ModelTime ...
func NewModelTime ¶
NewModelTime consumes a time.Duration and calculates the minutes, seconds, and milliseconds
type ModelTimings ¶
type ModelTimings struct {
CheckForStalledScansPause ModelTime
StalledScanClientTimeout ModelTime
ModelMetricsPause ModelTime
UnknownImagePause ModelTime
}
ModelTimings ...
type PostCommand ¶
type PostCommand struct {
ResetCircuitBreaker *bool
}
PostCommand handles commands. The values aren't important; only the presence or absence of a key matters.
type Responder ¶
type Responder interface {
GetModel() (*Model, error)
// perceiver
AddPod(pod Pod) error
UpdatePod(pod Pod) error
DeletePod(qualifiedName string)
GetScanResults() ScanResults
AddImage(image Image) error
UpdateAllPods(allPods AllPods) error
UpdateAllImages(allImages AllImages) error
// scanner
GetNextImage() NextImage
PostFinishScan(job FinishedScanClientJob) error
// internal use
PostCommand(commands *PostCommand)
// errors
NotFound(w http.ResponseWriter, r *http.Request)
Error(w http.ResponseWriter, r *http.Request, err error, statusCode int)
}
Responder interface stores all the methods corresponding to Perceptor api
type ScanResults ¶
type ScanResults struct {
Pods []ScannedPod
Images []ScannedImage
}
ScanResults .....
func NewScanResults ¶
func NewScanResults(pods []ScannedPod, images []ScannedImage) *ScanResults
NewScanResults .....