engine

package
v3.20.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2022 License: AGPL-3.0 Imports: 757 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultDetectors

func DefaultDetectors() []detectors.Detector

func FragmentFirstLine added in v3.19.0

func FragmentFirstLine(chunk *sources.Chunk) (int64, *int64)

FragmentFirstLine returns the first line number of a fragment along with a pointer to the value to update in the chunk metadata.

func FragmentLineOffset added in v3.4.3

func FragmentLineOffset(chunk *sources.Chunk, result *detectors.Result) int64

FragmentLineOffset sets the line number for a provided source chunk with a given detector result.

func SetResultLineNumber added in v3.19.0

func SetResultLineNumber(chunk *sources.Chunk, result *detectors.Result, fragStart int64, mdLine *int64)

SetResultLineNumber sets the line number in the provided result.

Types

type Engine

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

func Start

func Start(ctx context.Context, options ...EngineOption) *Engine

func (*Engine) BytesScanned added in v3.16.1

func (e *Engine) BytesScanned() uint64

func (*Engine) ChunksChan

func (e *Engine) ChunksChan() chan *sources.Chunk

func (*Engine) ChunksScanned

func (e *Engine) ChunksScanned() uint64

func (*Engine) DetectorAvgTime

func (e *Engine) DetectorAvgTime() map[string][]time.Duration

func (*Engine) Finish added in v3.6.1

func (e *Engine) Finish(ctx context.Context)

Finish waits for running sources to complete and workers to finish scanning chunks before closing their respective channels. Once Finish is called, no more sources may be scanned by the engine.

func (*Engine) ResultsChan

func (e *Engine) ResultsChan() chan detectors.ResultWithMetadata

func (*Engine) ScanFileSystem

func (e *Engine) ScanFileSystem(ctx context.Context, c sources.Config) error

ScanFileSystem scans a given file system.

func (*Engine) ScanGit

func (e *Engine) ScanGit(ctx context.Context, c sources.Config) error

ScanGit scans any git source.

func (*Engine) ScanGitHub

func (e *Engine) ScanGitHub(ctx context.Context, c sources.Config) error

ScanGitHub scans Github with the provided options.

func (*Engine) ScanGitLab

func (e *Engine) ScanGitLab(ctx context.Context, c sources.Config) error

ScanGitLab scans GitLab with the provided configuration.

func (*Engine) ScanS3

func (e *Engine) ScanS3(ctx context.Context, c sources.Config) error

ScanS3 scans S3 buckets.

func (*Engine) ScanSyslog added in v3.4.3

func (e *Engine) ScanSyslog(ctx context.Context, c sources.Config) error

ScanSyslog is a source that scans syslog files.

type EngineOption

type EngineOption func(*Engine)

func WithConcurrency

func WithConcurrency(concurrency int) EngineOption

func WithDecoders

func WithDecoders(decoders ...decoders.Decoder) EngineOption

func WithDetectors

func WithDetectors(verify bool, d ...detectors.Detector) EngineOption

func WithFilterUnverified added in v3.16.2

func WithFilterUnverified(filter bool) EngineOption

WithFilterUnverified sets the filterUnverified flag on the engine. If set to true, the engine will only return the first unverified result for a chunk for a detector.

Jump to

Keyboard shortcuts

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