keyscanner

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Finding

type Finding struct {
	File     string   `json:"file"`
	Line     int      `json:"line"`
	RuleName string   `json:"rule"`
	Match    string   `json:"match"`
	Severity Severity `json:"severity"`
}

func Scan

func Scan(root string) ([]Finding, error)

Scan walks root with default options (unlimited depth, no progress).

func ScanWithOptions

func ScanWithOptions(root string, opts Options) ([]Finding, error)

ScanWithOptions walks root respecting the supplied options.

type Options

type Options struct {
	// MaxDepth limits how many directory levels below Root are visited.
	// 0 means unlimited.
	MaxDepth int
	// Progress, if non-nil, is called with each file path before it is scanned.
	Progress func(path string)
}

Options controls scan behaviour.

type Rule

type Rule struct {
	Name     string
	Severity Severity
	Pattern  *regexp.Regexp
}

type Severity

type Severity string
const (
	SeverityCritical Severity = "critical"
	SeverityHigh     Severity = "high"
	SeverityMedium   Severity = "medium"
	SeverityLow      Severity = "low"
)

Jump to

Keyboard shortcuts

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