Documentation
¶
Index ¶
- func DefaultDetectors() []detectors.Detector
- func Detectors(ctx context.Context, dt DetectorFilter) ([]detectors.Detector, error)
- func FragmentFirstLine(chunk *sources.Chunk) (int64, *int64)
- func FragmentLineOffset(chunk *sources.Chunk, result *detectors.Result) int64
- func SetResultLineNumber(chunk *sources.Chunk, result *detectors.Result, fragStart int64, mdLine *int64)
- func SupportsLineNumbers(sourceType sourcespb.SourceType) bool
- type DetectorFilter
- type Engine
- func (e *Engine) BytesScanned() uint64
- func (e *Engine) ChunksChan() chan *sources.Chunk
- func (e *Engine) ChunksScanned() uint64
- func (e *Engine) DetectorAvgTime() map[string][]time.Duration
- func (e *Engine) Finish(ctx context.Context)
- func (e *Engine) ResultsChan() chan detectors.ResultWithMetadata
- func (e *Engine) ScanCircleCI(ctx context.Context, token string) error
- func (e *Engine) ScanFileSystem(ctx context.Context, c sources.FilesystemConfig) error
- func (e *Engine) ScanGit(ctx context.Context, c sources.GitConfig) error
- func (e *Engine) ScanGitHub(ctx context.Context, c sources.GithubConfig) error
- func (e *Engine) ScanGitLab(ctx context.Context, c sources.GitlabConfig) error
- func (e *Engine) ScanS3(ctx context.Context, c sources.S3Config) error
- func (e *Engine) ScanSyslog(ctx context.Context, c sources.SyslogConfig) error
- type EngineOption
- type ExcludeDetectorFilter
- type IncludeDetectorFilter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultDetectors ¶
func Detectors ¶ added in v3.27.0
Detectors only returns a specific set of detectors if they are specified in the detector list and are valid. Otherwise, an error is returned.
func FragmentFirstLine ¶ added in v3.19.0
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
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.
func SupportsLineNumbers ¶ added in v3.25.0
func SupportsLineNumbers(sourceType sourcespb.SourceType) bool
SupportsLineNumbers determines if a line number can be found for a source type.
Types ¶
type DetectorFilter ¶ added in v3.27.0
type DetectorFilter interface {
// contains filtered or unexported methods
}
DetectorFilter allows for include/exclude detectors.
func NewDetectorsConfig ¶ added in v3.27.0
func NewDetectorsConfig(include, exclude string) (DetectorFilter, error)
NewDetectorsConfig creates a new detector filter based on the include/exclude arguments.
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func (*Engine) BytesScanned ¶ added in v3.16.1
func (*Engine) ChunksChan ¶
func (*Engine) ChunksScanned ¶
func (*Engine) Finish ¶ added in v3.6.1
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) ScanCircleCI ¶ added in v3.23.0
ScanCircleCI scans CircleCI logs.
func (*Engine) ScanFileSystem ¶
ScanFileSystem scans a given file system.
func (*Engine) ScanGitHub ¶
ScanGitHub scans Github with the provided options.
func (*Engine) ScanGitLab ¶
ScanGitLab scans GitLab with the provided configuration.
func (*Engine) ScanSyslog ¶ added in v3.4.3
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.
type ExcludeDetectorFilter ¶ added in v3.27.0
type ExcludeDetectorFilter struct {
// contains filtered or unexported fields
}
ExcludeDetectorFilter is a detector filter that excludes the specified detectors.
type IncludeDetectorFilter ¶ added in v3.27.0
type IncludeDetectorFilter struct {
// contains filtered or unexported fields
}
IncludeDetectorFilter is a detector filter that only includes the specified detectors.