engine

package
v0.0.0-...-fd430d6 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloneRepository

func CloneRepository(url, branch string, checkoutDir string) error

func DeleteTmpDirectory

func DeleteTmpDirectory(path string)

Types

type Controller

type Controller struct {
	Incoming   chan *Job
	Cancelling chan *Job
	Quit       chan bool

	QuitFlag bool
	// contains filtered or unexported fields
}

func (*Controller) AddJob

func (c *Controller) AddJob(ri *models.RepositoryInfo) *Job

API to allow users to add jobs to the controller queue. Returns a Job struct containing the identifier for the queued job, as well as the results channel where the output will be sent.

func (*Controller) Initialize

func (c *Controller) Initialize(scanner ScanHandler)

Setup the controller for use

func (*Controller) RemoveJob

func (c *Controller) RemoveJob(job *Job)

API to allow users to cancel jobs that are in the controller queue. When a job is cancelled by the user, the user should no longer perform any additional processing for the job. No further data should be expected from the results channel.

func (*Controller) Run

func (c *Controller) Run()

Starts the controller. It will continue running until a message is received from the Quit channel. Initialize() must be called before calling this function.

func (*Controller) RunOnce

func (c *Controller) RunOnce()

The controller will execute for one loop. Initialize() must be called before calling this function.

func (*Controller) Stop

func (c *Controller) Stop()

Notifies the controller to stop running. This is not guaranteed to be immediate, and pending jobs may still be processed before execution stops.

type Job

type Job struct {
	Id     string
	Repo   *models.RepositoryInfo
	Result chan *JobUpdate
}

type JobUpdate

type JobUpdate struct {
	Status   string
	Findings []*models.FindingsInfo
}

type RuleDefinition

type RuleDefinition struct {
	Id          string
	Description string
	Severity    string
}

type ScanHandler

type ScanHandler interface {
	StartScan(*Job)
	StopScan(*Job)
}

type Scanner

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

func (*Scanner) CleanUp

func (s *Scanner) CleanUp()

func (*Scanner) Initialize

func (s *Scanner) Initialize(limit int, noop bool)

func (*Scanner) StartScan

func (s *Scanner) StartScan(j *Job)

func (*Scanner) StopScan

func (s *Scanner) StopScan(j *Job)

func (*Scanner) Work

func (s *Scanner) Work(id string)

type SecretFinder

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

func (*SecretFinder) FindSecrets

func (a *SecretFinder) FindSecrets(basepath string) []*models.FindingsInfo

func (*SecretFinder) Initialize

func (a *SecretFinder) Initialize()

func (*SecretFinder) ScanFile

func (a *SecretFinder) ScanFile(path string) error

func (*SecretFinder) WalkDirHandler

func (a *SecretFinder) WalkDirHandler(path string, d fs.DirEntry, err error) error

Jump to

Keyboard shortcuts

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