Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MergeSR ¶
func MergeSR(source *claircore.ScanReport, merge []*claircore.ScanReport) *claircore.ScanReport
MergeSR merges ScanReports.
source is the ScanReport that the scanner is working on. merge is an array ScanReports returned from coalescers
Types ¶
type Controller ¶
type Controller struct { // holds dependencies for a scanner.controller *scanner.Opts // contains filtered or unexported fields }
Controller is a control structure for scanning a manifest.
Controller is implemented as an FSM.
func New ¶
func New(opts *scanner.Opts) *Controller
New constructs a controller given an Opts struct
func (*Controller) Scan ¶
func (s *Controller) Scan(ctx context.Context, manifest *claircore.Manifest) *claircore.ScanReport
Scan kicks off a scan of a particular manifest. Initial state set in constructor. Call Lock() before using and Unlock() when finished scanning.
func (*Controller) Unlock ¶
func (s *Controller) Unlock() error
type State ¶
type State int
State is a specific state in the scanner fsm
const ( // Terminal is the state which halts the fsm and returns the current s.result to the caller Terminal State = iota // CheckManifest determines if the manifest should be scanned. // if no Terminal is returned and we return the existing ScanReport. // Transitions: FetchLayers, Terminal CheckManifest // FetchLayers retrieves all the layers in a manifest and stacks them the same obtain the file image contents. // creates the "image" layer // Transitions: LayerScan FetchLayers // ScanLayers scans each image including the image layer and indexes the contents // Transitions: BuildLayerResult ScanLayers // Coalesce runs each provided ecosystem's coalescer and mergs their scan results // Transitions: ScanFinished Coalesce // ScanError state indicates a impassable error has occured. // returns a ScanResult with the error field // Transitions: Terminal ScanError // ScanFinished state is the terminal state and should return a ScanReport // to the caller of Scan() // Transitions: Terminal ScanFinished )
States and their explanations. each state is implemented by a stateFunc implemented in their own files.
func (*State) FromString ¶
func (State) MarshalJSON ¶
func (*State) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.