Documentation
¶
Index ¶
- func DirExists(root, rel string) bool
- func DirExistsWithinRoot(detectorID, root, rel string) (bool, *model.ParseError)
- func FileExists(root, rel string) bool
- func FileExistsWithinRoot(detectorID, root, rel string) (bool, *model.ParseError)
- func Glob(root, pattern string) ([]string, error)
- func IsLocalMachineScope(scope Scope) bool
- func OpenFileWithinRoot(detectorID, root, rel string) (*os.File, *model.ParseError)
- func ParseErrorAsError(parseErr *model.ParseError) error
- func ParseJSONFile(detectorID, root, rel string, dst any) *model.ParseError
- func ParseJSONFileAllowUnknownFields(detectorID, root, rel string, dst any) *model.ParseError
- func ParseTOMLFile(detectorID, root, rel string, dst any) *model.ParseError
- func ParseTOMLFileAllowUnknownFields(detectorID, root, rel string, dst any) *model.ParseError
- func ParseYAMLFile(detectorID, root, rel string, dst any) *model.ParseError
- func ParseYAMLFileAllowUnknownFields(detectorID, root, rel string, dst any) *model.ParseError
- func ReadFileWithinRoot(detectorID, root, rel string) ([]byte, *model.ParseError)
- func ValidateScopeRoot(root string) error
- func WalkFiles(root string) ([]string, error)
- type Detector
- type DetectorError
- type Options
- type Registry
- type RunResult
- type Scope
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DirExistsWithinRoot ¶ added in v1.1.0
func DirExistsWithinRoot(detectorID, root, rel string) (bool, *model.ParseError)
func FileExists ¶
func FileExistsWithinRoot ¶ added in v1.0.9
func FileExistsWithinRoot(detectorID, root, rel string) (bool, *model.ParseError)
func IsLocalMachineScope ¶ added in v1.0.8
func OpenFileWithinRoot ¶ added in v1.0.9
func OpenFileWithinRoot(detectorID, root, rel string) (*os.File, *model.ParseError)
func ParseErrorAsError ¶ added in v1.1.0
func ParseErrorAsError(parseErr *model.ParseError) error
func ParseJSONFile ¶
func ParseJSONFile(detectorID, root, rel string, dst any) *model.ParseError
func ParseJSONFileAllowUnknownFields ¶ added in v1.0.8
func ParseJSONFileAllowUnknownFields(detectorID, root, rel string, dst any) *model.ParseError
func ParseTOMLFile ¶
func ParseTOMLFile(detectorID, root, rel string, dst any) *model.ParseError
func ParseTOMLFileAllowUnknownFields ¶ added in v1.0.8
func ParseTOMLFileAllowUnknownFields(detectorID, root, rel string, dst any) *model.ParseError
func ParseYAMLFile ¶
func ParseYAMLFile(detectorID, root, rel string, dst any) *model.ParseError
func ParseYAMLFileAllowUnknownFields ¶ added in v1.0.8
func ParseYAMLFileAllowUnknownFields(detectorID, root, rel string, dst any) *model.ParseError
func ReadFileWithinRoot ¶ added in v1.0.9
func ReadFileWithinRoot(detectorID, root, rel string) ([]byte, *model.ParseError)
func ValidateScopeRoot ¶ added in v1.0.8
ValidateScopeRoot ensures detector scope roots are valid directories.
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 DetectorError ¶ added in v1.0.8
type DetectorError struct {
Detector string `json:"detector"`
Org string `json:"org"`
Repo string `json:"repo"`
Code string `json:"code"`
Class string `json:"class"`
Message string `json:"message"`
}
DetectorError captures a non-fatal detector failure tied to one scope.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry stores detectors with deterministic execution order.
func NewRegistry ¶
func NewRegistry() *Registry
type RunResult ¶ added in v1.0.8
type RunResult struct {
Findings []model.Finding `json:"findings"`
DetectorErrors []DetectorError `json:"detector_errors,omitempty"`
}
RunResult contains deterministic findings and non-fatal detector errors.
Click to show internal directories.
Click to hide internal directories.