detect

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirExists

func DirExists(root, rel string) bool

func FileExists

func FileExists(root, rel string) bool

func Glob

func Glob(root, pattern string) ([]string, error)

func ParseJSONFile

func ParseJSONFile(detectorID, root, rel string, dst any) *model.ParseError

func ParseTOMLFile

func ParseTOMLFile(detectorID, root, rel string, dst any) *model.ParseError

func ParseYAMLFile

func ParseYAMLFile(detectorID, root, rel string, dst any) *model.ParseError

func WalkFiles

func WalkFiles(root string) ([]string, error)

Types

type Detector

type Detector interface {
	ID() string
	Detect(context.Context, Scope, Options) ([]model.Finding, error)
}

Detector emits canonical findings for one repo scope.

type Options

type Options struct {
	Enrich bool
}

Options toggles optional detector behavior.

type Registry

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

Registry stores detectors with deterministic execution order.

func NewRegistry

func NewRegistry() *Registry

func (*Registry) Register

func (r *Registry) Register(detector Detector) error

func (*Registry) Run

func (r *Registry) Run(ctx context.Context, scopes []Scope, options Options) ([]model.Finding, error)

type Scope

type Scope struct {
	Org  string
	Repo string
	Root string
}

Scope is one deterministic repository scan input.

Jump to

Keyboard shortcuts

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