Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Default = NewRegistry()
Default is the process-wide default registry. Detector init() funcs call RegisterDefault to add themselves.
Functions ¶
func RegisterDefault ¶
func RegisterDefault(d Detector)
RegisterDefault registers d with the process-wide Default registry. Panics on duplicate name (programmer error — must be caught at boot, not silently swallowed).
Types ¶
type Context ¶
type Context struct {
FilePath string
Language string
Content string
Tree *parser.Tree // nil for languages without a tree-sitter grammar
ModuleName string
// ParsedData is the pre-parsed structured payload for YAML/JSON/TOML/INI/
// properties files. Wrapped in the same envelope shape used by the Java
// side: a map with keys "type" (e.g. "yaml", "yaml_multi", "json", "toml",
// "ini", "properties") and "data" / "documents". nil for files that don't
// participate in structured parsing.
ParsedData map[string]any
}
Context is the per-file payload threaded through every Detect call. Mirrors Java DetectorContext.
type Detector ¶
type Detector interface {
Name() string
SupportedLanguages() []string
// DefaultConfidence is the floor stamped onto every emission that does not
// explicitly set Confidence — equivalent to Java's defaultConfidence().
DefaultConfidence() model.Confidence
Detect(ctx *Context) *Result
}
Detector is the contract every detector implements. Mirrors Java io.github.randomcodespace.iq.detector.Detector.
Detectors must be stateless — phase 1 invokes each detector from goroutines concurrently. Use method-local state only.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry holds detectors registered at process startup. Lookups by language return deterministic (name-sorted) slices so detector iteration order is stable across runs — determinism is non-negotiable per CLAUDE.md.
type Result ¶
Result is what a single Detect call returns. Mirrors Java DetectorResult.
func EmptyResult ¶
func EmptyResult() *Result
EmptyResult returns an empty Result. Sentinel for "nothing matched".
Directories
¶
| Path | Synopsis |
|---|---|
|
Package auth holds cross-cutting authentication-related detectors.
|
Package auth holds cross-cutting authentication-related detectors. |
|
Package base frontend.go provides shared helpers for frontend component detectors (Angular, React, Vue).
|
Package base frontend.go provides shared helpers for frontend component detectors (Angular, React, Vue). |
|
Package csharp holds C#/.NET detectors.
|
Package csharp holds C#/.NET detectors. |
|
Package golang holds Go-language detectors.
|
Package golang holds Go-language detectors. |
|
Package iac holds Infrastructure-as-Code detectors (Terraform, Bicep, Dockerfile, ...).
|
Package iac holds Infrastructure-as-Code detectors (Terraform, Bicep, Dockerfile, ...). |
|
jvm
|
|
|
jvmhelpers
Package jvmhelpers mirrors src/main/java/.../detector/StructuresDetectorHelper.java + AbstractJavaMessagingDetector helpers for JVM-family Go detectors.
|
Package jvmhelpers mirrors src/main/java/.../detector/StructuresDetectorHelper.java + AbstractJavaMessagingDetector helpers for JVM-family Go detectors. |
|
Package markup holds Markdown / other markup-language detectors.
|
Package markup holds Markdown / other markup-language detectors. |
|
Package proto holds Protocol Buffer detectors.
|
Package proto holds Protocol Buffer detectors. |
|
script
|
|
|
shell
Package shell holds Bash and PowerShell detectors.
|
Package shell holds Bash and PowerShell detectors. |
|
Package sql holds raw-SQL and migration-file detectors.
|
Package sql holds raw-SQL and migration-file detectors. |
|
systems
|
|
|
cpp
Package cpp holds C/C++ detectors.
|
Package cpp holds C/C++ detectors. |
|
rust
Package rust holds Rust-language detectors.
|
Package rust holds Rust-language detectors. |
|
Package typescript ports the Java TypeScript detectors.
|
Package typescript ports the Java TypeScript detectors. |