Documentation
¶
Index ¶
Constants ¶
View Source
const ( PerceptorBaseURL = "http://perceptor" // perceptor-scanner paths NextImagePath = "nextimage" FinishedScanPath = "finishedscan" // perceiver paths PodPath = "pod" ImagePath = "image" ScanResultsPath = "scanresults" AllPodsPath = "allpods" // ports (basically so that you can run these locally without them stomping on each other -- for testing) PerceptorPort = "3001" PerceiverPort = "3002" PerceptorScannerPort = "3003" )
Two 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
Variables ¶
This section is empty.
Functions ¶
func SetupHTTPServer ¶
func SetupHTTPServer(responder Responder)
Types ¶
type AllPods ¶
func NewAllPods ¶
type FinishedScanClientJob ¶
type NextImage ¶
func NewNextImage ¶
type Responder ¶
type Responder interface {
// state of the program
// this is a funky return type because it's so tightly coupled to prometheus
GetMetrics(w http.ResponseWriter, r *http.Request)
GetModel() string
// perceiver
AddPod(pod common.Pod)
UpdatePod(pod common.Pod)
DeletePod(qualifiedName string)
GetScanResults() ScanResults
AddImage(image common.Image)
UpdateAllPods(allPods AllPods)
// scanner
GetNextImage(func(nextImage NextImage))
PostFinishScan(job FinishedScanClientJob)
// errors
NotFound(w http.ResponseWriter, r *http.Request)
Error(w http.ResponseWriter, r *http.Request, err error, statusCode int)
}
type ScanResults ¶
type ScanResults struct {
// TODO should ScannerVersion and HubServer be handled by perceiver, or supplied by perceptor?
ScannerVersion string
HubServer string
Pods []Pod
Images []Image
}
func NewScanResults ¶
func NewScanResults(scannerVersion string, hubServer string, pods []Pod, images []Image) *ScanResults
Click to show internal directories.
Click to hide internal directories.