detector

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CategoryLanguage    = "language"
	CategoryFramework   = "framework"
	CategoryDatabase    = "database"
	CategoryCache       = "cache"
	CategoryQueue       = "queue"
	CategoryFrontend    = "frontend"
	CategoryCSS         = "css"
	CategoryUI          = "ui"
	CategoryORM         = "orm"
	CategoryAPI         = "api"
	CategoryAuth        = "auth"
	CategoryEmail       = "email"
	CategorySearch      = "search"
	CategoryStorage     = "storage"
	CategoryMonitoring  = "monitoring"
	CategoryTesting     = "testing"
	CategoryLinting     = "linting"
	CategoryFormatting  = "formatting"
	CategoryCI          = "ci"
	CategoryDeploy      = "deploy"
	CategoryInfra       = "infra"
	CategorySecurity    = "security"
	CategoryML          = "ml"
	CategoryPlatform    = "platform"
	CategoryPkgManager  = "package_manager"
	CategoryVersionMgr  = "version_manager"
	CategoryBuild       = "build"
	CategoryPayments    = "payments"
	CategoryAnalytics   = "analytics"
	CategoryFeatureFlag = "feature_flags"
)

Category constants for classifying detected technologies.

Variables

CategoryOrder defines the display order for categories.

View Source
var Registry []Detector

Registry holds all registered detectors.

Functions

func CategoryLabel

func CategoryLabel(cat string) string

CategoryLabel returns a human-readable label for a category.

func CleanVersion

func CleanVersion(raw string) string

CleanVersion extracts a clean major.minor version string. It strips common prefixes (~>, ^, >=) and suffixes (-alpine, -slim, etc.), then returns major.minor (dropping patch).

func Register

func Register(d Detector)

Register adds a detector to the global registry.

Types

type APISpecDetector

type APISpecDetector struct{}

func (*APISpecDetector) Detect

func (d *APISpecDetector) Detect(dir string, fileIndex map[string]bool) ([]Finding, error)

func (*APISpecDetector) Name

func (d *APISpecDetector) Name() string

type BazelDetector

type BazelDetector struct{}

func (*BazelDetector) Detect

func (d *BazelDetector) Detect(dir string, fileIndex map[string]bool) ([]Finding, error)

func (*BazelDetector) Name

func (d *BazelDetector) Name() string

type ClojureDetector

type ClojureDetector struct{}

func (*ClojureDetector) Detect

func (d *ClojureDetector) Detect(dir string, fileIndex map[string]bool) ([]Finding, error)

func (*ClojureDetector) Name

func (d *ClojureDetector) Name() string

type CloudDetector

type CloudDetector struct{}

func (*CloudDetector) Detect

func (d *CloudDetector) Detect(dir string, fileIndex map[string]bool) ([]Finding, error)

func (*CloudDetector) Name

func (d *CloudDetector) Name() string

type CppDetector

type CppDetector struct{}

func (*CppDetector) Detect

func (d *CppDetector) Detect(dir string, fileIndex map[string]bool) ([]Finding, error)

func (*CppDetector) Name

func (d *CppDetector) Name() string

type CrystalDetector

type CrystalDetector struct{}

func (*CrystalDetector) Detect

func (d *CrystalDetector) Detect(dir string, fileIndex map[string]bool) ([]Finding, error)

func (*CrystalDetector) Name

func (d *CrystalDetector) Name() string

type DartDetector

type DartDetector struct{}

func (*DartDetector) Detect

func (d *DartDetector) Detect(dir string, fileIndex map[string]bool) ([]Finding, error)

func (*DartDetector) Name

func (d *DartDetector) Name() string

type DenoDetector

type DenoDetector struct{}

func (*DenoDetector) Detect

func (d *DenoDetector) Detect(dir string, fileIndex map[string]bool) ([]Finding, error)

func (*DenoDetector) Name

func (d *DenoDetector) Name() string

type Detector

type Detector interface {
	Name() string
	Detect(dir string, fileIndex map[string]bool) ([]Finding, error)
}

Detector inspects a project directory and returns findings.

type DockerDetector

type DockerDetector struct{}

func (*DockerDetector) Detect

func (d *DockerDetector) Detect(dir string, fileIndex map[string]bool) ([]Finding, error)

func (*DockerDetector) Name

func (d *DockerDetector) Name() string

type DotNetDetector

type DotNetDetector struct{}

func (*DotNetDetector) Detect

func (d *DotNetDetector) Detect(dir string, fileIndex map[string]bool) ([]Finding, error)

func (*DotNetDetector) Name

func (d *DotNetDetector) Name() string

type ElixirDetector

type ElixirDetector struct{}

func (*ElixirDetector) Detect

func (d *ElixirDetector) Detect(dir string, fileIndex map[string]bool) ([]Finding, error)

func (*ElixirDetector) Name

func (d *ElixirDetector) Name() string

type ElmDetector

type ElmDetector struct{}

func (*ElmDetector) Detect

func (d *ElmDetector) Detect(dir string, fileIndex map[string]bool) ([]Finding, error)

func (*ElmDetector) Name

func (d *ElmDetector) Name() string

type ErlangDetector

type ErlangDetector struct{}

func (*ErlangDetector) Detect

func (d *ErlangDetector) Detect(dir string, fileIndex map[string]bool) ([]Finding, error)

func (*ErlangDetector) Name

func (d *ErlangDetector) Name() string

type Finding

type Finding struct {
	Category string `json:"category"`
	Name     string `json:"name"`
	Version  string `json:"version,omitempty"`
	Source   string `json:"source"`
}

Finding represents a single detected technology.

func ApplyVersionManagerOverrides added in v0.3.0

func ApplyVersionManagerOverrides(dir string, fileIndex map[string]bool, findings []Finding) []Finding

ApplyVersionManagerOverrides replaces language findings' versions with values declared in .tool-versions (asdf/mise). The version-manager file is authoritative for the dev environment, while manifest files often declare only a minimum (e.g. `elixir: "~> 1.15"` in mix.exs).

type GleamDetector

type GleamDetector struct{}

func (*GleamDetector) Detect

func (d *GleamDetector) Detect(dir string, fileIndex map[string]bool) ([]Finding, error)

func (*GleamDetector) Name

func (d *GleamDetector) Name() string

type GoDetector

type GoDetector struct{}

func (*GoDetector) Detect

func (d *GoDetector) Detect(dir string, fileIndex map[string]bool) ([]Finding, error)

func (*GoDetector) Name

func (d *GoDetector) Name() string

type HaskellDetector

type HaskellDetector struct{}

func (*HaskellDetector) Detect

func (d *HaskellDetector) Detect(dir string, fileIndex map[string]bool) ([]Finding, error)

func (*HaskellDetector) Name

func (d *HaskellDetector) Name() string

type IOSDetector

type IOSDetector struct{}

func (*IOSDetector) Detect

func (d *IOSDetector) Detect(dir string, fileIndex map[string]bool) ([]Finding, error)

func (*IOSDetector) Name

func (d *IOSDetector) Name() string

type InfraDetector

type InfraDetector struct{}

func (*InfraDetector) Detect

func (d *InfraDetector) Detect(dir string, fileIndex map[string]bool) ([]Finding, error)

func (*InfraDetector) Name

func (d *InfraDetector) Name() string

type JavaDetector

type JavaDetector struct{}

func (*JavaDetector) Detect

func (d *JavaDetector) Detect(dir string, fileIndex map[string]bool) ([]Finding, error)

func (*JavaDetector) Name

func (d *JavaDetector) Name() string

type JuliaDetector

type JuliaDetector struct{}

func (*JuliaDetector) Detect

func (d *JuliaDetector) Detect(dir string, fileIndex map[string]bool) ([]Finding, error)

func (*JuliaDetector) Name

func (d *JuliaDetector) Name() string

type KamalDetector added in v0.3.0

type KamalDetector struct{}

func (*KamalDetector) Detect added in v0.3.0

func (d *KamalDetector) Detect(dir string, fileIndex map[string]bool) ([]Finding, error)

func (*KamalDetector) Name added in v0.3.0

func (d *KamalDetector) Name() string

type LuaDetector

type LuaDetector struct{}

func (*LuaDetector) Detect

func (d *LuaDetector) Detect(dir string, fileIndex map[string]bool) ([]Finding, error)

func (*LuaDetector) Name

func (d *LuaDetector) Name() string

type NimDetector

type NimDetector struct{}

func (*NimDetector) Detect

func (d *NimDetector) Detect(dir string, fileIndex map[string]bool) ([]Finding, error)

func (*NimDetector) Name

func (d *NimDetector) Name() string

type NodeDetector

type NodeDetector struct{}

func (*NodeDetector) Detect

func (d *NodeDetector) Detect(dir string, fileIndex map[string]bool) ([]Finding, error)

func (*NodeDetector) Name

func (d *NodeDetector) Name() string

type OCamlDetector

type OCamlDetector struct{}

func (*OCamlDetector) Detect

func (d *OCamlDetector) Detect(dir string, fileIndex map[string]bool) ([]Finding, error)

func (*OCamlDetector) Name

func (d *OCamlDetector) Name() string

type PHPDetector

type PHPDetector struct{}

func (*PHPDetector) Detect

func (d *PHPDetector) Detect(dir string, fileIndex map[string]bool) ([]Finding, error)

func (*PHPDetector) Name

func (d *PHPDetector) Name() string

type PerlDetector

type PerlDetector struct{}

func (*PerlDetector) Detect

func (d *PerlDetector) Detect(dir string, fileIndex map[string]bool) ([]Finding, error)

func (*PerlDetector) Name

func (d *PerlDetector) Name() string

type PureScriptDetector

type PureScriptDetector struct{}

func (*PureScriptDetector) Detect

func (d *PureScriptDetector) Detect(dir string, fileIndex map[string]bool) ([]Finding, error)

func (*PureScriptDetector) Name

func (d *PureScriptDetector) Name() string

type PythonDetector

type PythonDetector struct{}

func (*PythonDetector) Detect

func (d *PythonDetector) Detect(dir string, fileIndex map[string]bool) ([]Finding, error)

func (*PythonDetector) Name

func (d *PythonDetector) Name() string

type RLangDetector

type RLangDetector struct{}

func (*RLangDetector) Detect

func (d *RLangDetector) Detect(dir string, fileIndex map[string]bool) ([]Finding, error)

func (*RLangDetector) Name

func (d *RLangDetector) Name() string

type RubyDetector

type RubyDetector struct{}

func (*RubyDetector) Detect

func (d *RubyDetector) Detect(dir string, fileIndex map[string]bool) ([]Finding, error)

func (*RubyDetector) Name

func (d *RubyDetector) Name() string

type RustDetector

type RustDetector struct{}

func (*RustDetector) Detect

func (d *RustDetector) Detect(dir string, fileIndex map[string]bool) ([]Finding, error)

func (*RustDetector) Name

func (d *RustDetector) Name() string

type ScalaDetector

type ScalaDetector struct{}

func (*ScalaDetector) Detect

func (d *ScalaDetector) Detect(dir string, fileIndex map[string]bool) ([]Finding, error)

func (*ScalaDetector) Name

func (d *ScalaDetector) Name() string

type SolidityDetector

type SolidityDetector struct{}

func (*SolidityDetector) Detect

func (d *SolidityDetector) Detect(dir string, fileIndex map[string]bool) ([]Finding, error)

func (*SolidityDetector) Name

func (d *SolidityDetector) Name() string

type SwiftDetector

type SwiftDetector struct{}

func (*SwiftDetector) Detect

func (d *SwiftDetector) Detect(dir string, fileIndex map[string]bool) ([]Finding, error)

func (*SwiftDetector) Name

func (d *SwiftDetector) Name() string

type VDetector

type VDetector struct{}

func (*VDetector) Detect

func (d *VDetector) Detect(dir string, fileIndex map[string]bool) ([]Finding, error)

func (*VDetector) Name

func (d *VDetector) Name() string

type ZigDetector

type ZigDetector struct{}

func (*ZigDetector) Detect

func (d *ZigDetector) Detect(dir string, fileIndex map[string]bool) ([]Finding, error)

func (*ZigDetector) Name

func (d *ZigDetector) Name() string

Jump to

Keyboard shortcuts

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