Versions in this module Expand all Collapse all v0 v0.2.0 Nov 4, 2026 Changes in this version + const SlowWarningThreshold + func IsNew(finding report.Finding, redact uint, baseline []report.Finding) bool + func LoadBaseline(baselinePath string) ([]report.Finding, error) + func RedactFindings(findings []report.Finding, percent uint) + func SortRuleTimings(timings []RuleTiming) + func WriteRuleTimingsCSV(w io.Writer, timings []RuleTiming) error + func WriteRuleTimingsHuman(w io.Writer, timings []RuleTiming) error + type Detector struct + Config *config.Config + FollowSymlinks bool + IgnoreGitleaksAllow bool + LegacyPrint bool + MatchContext contextwindow.Spec + MaxArchiveDepth int + MaxDecodeDepth int + MaxTargetMegaBytes int + MinConfidence string + NoColor bool + Redact uint + ReportPath string + Reporter report.Reporter + RuleTimings *RuleTimingCollector + Sema *semgroup.Group + SkipFindingAppend bool + TotalBytes atomic.Uint64 + ValidationCounts map[report.ValidationStatus]int + ValidationExtractEmpty bool + ValidationPool *validate.Pool + ValidationStatusFilter map[string]struct{} + Verbose bool + func NewDetector(cfg *config.Config) *Detector + func NewDetectorContext(ctx context.Context, cfg *config.Config, valOpts ValidationOptions) *Detector + func NewDetectorDefaultConfig() (*Detector, error) + func (d *Detector) AddBaseline(baselinePath string, source string) error + func (d *Detector) AddFinding(finding report.Finding) + func (d *Detector) AddGitleaksIgnore(gitleaksIgnorePath string) error + func (d *Detector) Detect(fragment sources.Fragment) []report.Finding + func (d *Detector) DetectContext(ctx context.Context, fragment sources.Fragment) []report.Finding + func (d *Detector) DetectFragment(ctx context.Context, fragment sources.Fragment) []report.Finding + func (d *Detector) DetectFragmentRuleWindows(ctx context.Context, fragment sources.Fragment, ruleIDs []string, ...) []report.Finding + func (d *Detector) DetectSource(ctx context.Context, source sources.Source) ([]report.Finding, error) + func (d *Detector) DetectString(content string) []report.Finding + func (d *Detector) DetectStringRuleWindows(content string, ruleIDs []string, windows map[string][]RuleWindow) []report.Finding + func (d *Detector) DetectStringRules(content string, ruleIDs []string) []report.Finding + func (d *Detector) FilterByStatus(findings []report.Finding) []report.Finding + func (d *Detector) Findings() []report.Finding + func (d *Detector) Run(ctx context.Context, source sources.Source) iter.Seq[Result] + func (d *Detector) SkipFunc() sources.SkipFunc + func (d *Detector) Tokenizer() *tiktoken.Tiktoken + func (d *Detector) ValidateFindings(ctx context.Context, findings []report.Finding) ([]report.Finding, error) + type Location struct + type Result struct + Err error + Finding report.Finding + type RuleTiming struct + Hits uint64 + RuleID string + Total time.Duration + func (rt RuleTiming) Average() time.Duration + type RuleTimingCollector struct + func NewRuleTimingCollector() *RuleTimingCollector + func (c *RuleTimingCollector) Record(ruleID string, duration time.Duration) + func (c *RuleTimingCollector) Snapshot() []RuleTiming + type RuleWindow struct + End int + Start int + StartLine int + type TiktokenLoader struct + func (l *TiktokenLoader) LoadTiktokenBpe(file string) (map[string]int, error) + type ValidationOptions struct + Debug bool + Enabled bool + ExtractEmpty bool + MaxRequestsPerTarget int + RequestsPerSecond float64 + RequestsPerSecondByRule map[string]float64 + StatusFilter string + Timeout time.Duration + ValidationEnvVars []string + Workers int