Documentation
¶
Overview ¶
Package frameworks - detection.go provides framework detection utilities This centralizes file path indicators used to detect frameworks in codebases
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AllFrameworkIndicators = func() []FrameworkIndicator { all := make([]FrameworkIndicator, 0) all = append(all, PHPFrameworkIndicators...) all = append(all, RubyFrameworkIndicators...) all = append(all, JavaScriptFrameworkIndicators...) all = append(all, PythonFrameworkIndicators...) all = append(all, JavaFrameworkIndicators...) all = append(all, GoFrameworkIndicators...) all = append(all, CSharpFrameworkIndicators...) all = append(all, RustFrameworkIndicators...) all = append(all, CppFrameworkIndicators...) return all }()
AllFrameworkIndicators contains all framework indicators across all languages
var CSharpFrameworkIndicators = []FrameworkIndicator{ { Framework: "aspnetcore", Language: "csharp", Indicators: []string{"Program.cs", "Startup.cs", ".csproj"}, Description: "ASP.NET Core", }, { Framework: "aspnetmvc", Language: "csharp", Indicators: []string{"Global.asax.cs", "Web.config"}, Description: "ASP.NET MVC", }, }
CSharpFrameworkIndicators contains file path indicators for C# frameworks
var CppFrameworkIndicators = []FrameworkIndicator{ { Framework: "qt", Language: "cpp", Indicators: []string{".pro", "CMakeLists.txt"}, Description: "Qt framework", }, { Framework: "poco", Language: "cpp", Indicators: []string{"CMakeLists.txt"}, Description: "POCO C++ Libraries", }, }
CppFrameworkIndicators contains file path indicators for C++ frameworks
var GoFrameworkIndicators = []FrameworkIndicator{ { Framework: "gin", Language: "go", Indicators: []string{"go.mod", "main.go"}, Description: "Gin web framework", }, { Framework: "echo", Language: "go", Indicators: []string{"go.mod"}, Description: "Echo web framework", }, }
GoFrameworkIndicators contains file path indicators for Go frameworks
var JavaFrameworkIndicators = []FrameworkIndicator{ { Framework: "spring", Language: "java", Indicators: []string{"pom.xml", "application.properties", "application.yml"}, Description: "Spring Framework", }, { Framework: "springboot", Language: "java", Indicators: []string{"src/main/java", "Application.java"}, Description: "Spring Boot", }, }
JavaFrameworkIndicators contains file path indicators for Java frameworks
var JavaScriptFrameworkIndicators = []FrameworkIndicator{ { Framework: "express", Language: "javascript", Indicators: []string{"node_modules/express", "package.json"}, Description: "Express.js web framework", }, { Framework: "nextjs", Language: "javascript", Indicators: []string{"next.config.js", "next.config.mjs", "pages/", "app/"}, Description: "Next.js React framework", }, { Framework: "nuxt", Language: "javascript", Indicators: []string{"nuxt.config.js", "nuxt.config.ts"}, Description: "Nuxt.js Vue framework", }, { Framework: "nestjs", Language: "typescript", Indicators: []string{"nest-cli.json", "src/main.ts"}, Description: "NestJS framework", }, { Framework: "koa", Language: "javascript", Indicators: []string{"node_modules/koa"}, Description: "Koa web framework", }, { Framework: "fastify", Language: "javascript", Indicators: []string{"node_modules/fastify"}, Description: "Fastify web framework", }, }
JavaScriptFrameworkIndicators contains file path indicators for JavaScript frameworks
var PHPFrameworkIndicators = []FrameworkIndicator{ { Framework: "laravel", Language: "php", Indicators: []string{"artisan", "bootstrap/app.php"}, Description: "Laravel framework", }, { Framework: "symfony", Language: "php", Indicators: []string{"symfony.lock", "config/bundles.php"}, Description: "Symfony framework", }, }
PHPFrameworkIndicators contains file path indicators for PHP frameworks Note: Only Laravel and Symfony are supported
var PythonFrameworkIndicators = []FrameworkIndicator{ { Framework: "django", Language: "python", Indicators: []string{"manage.py", "settings.py", "urls.py"}, Description: "Django web framework", }, { Framework: "flask", Language: "python", Indicators: []string{"app.py", "wsgi.py"}, Description: "Flask web framework", }, { Framework: "fastapi", Language: "python", Indicators: []string{"main.py"}, Description: "FastAPI web framework", }, }
PythonFrameworkIndicators contains file path indicators for Python frameworks
var RubyFrameworkIndicators = []FrameworkIndicator{ { Framework: "rails", Language: "ruby", Indicators: []string{"config/application.rb", "config/routes.rb", "app/controllers"}, Description: "Ruby on Rails", }, { Framework: "sinatra", Language: "ruby", Indicators: []string{"config.ru"}, Description: "Sinatra web framework", }, { Framework: "hanami", Language: "ruby", Indicators: []string{"config/environment.rb", "lib/"}, Description: "Hanami framework", }, { Framework: "padrino", Language: "ruby", Indicators: []string{"config/boot.rb", "config/apps.rb"}, Description: "Padrino framework", }, }
RubyFrameworkIndicators contains file path indicators for Ruby frameworks
var RustFrameworkIndicators = []FrameworkIndicator{ { Framework: "actix-web", Language: "rust", Indicators: []string{"Cargo.toml"}, Description: "Actix-web framework", }, { Framework: "rocket", Language: "rust", Indicators: []string{"Cargo.toml", "Rocket.toml"}, Description: "Rocket framework", }, { Framework: "axum", Language: "rust", Indicators: []string{"Cargo.toml"}, Description: "Axum framework", }, }
RustFrameworkIndicators contains file path indicators for Rust frameworks
Functions ¶
func DetectFramework ¶
DetectFramework detects which framework is being used in a codebase Returns the framework name or "unknown" if not detected
func DetectFrameworkByLanguage ¶
DetectFrameworkByLanguage detects which framework is being used for a specific language
func GetFrameworkIndicators ¶
GetFrameworkIndicators returns all indicators for a specific framework
func GetFrameworksForLanguage ¶
GetFrameworksForLanguage returns all known frameworks for a language
func RegisterAllDetectors ¶
func RegisterAllDetectors()
RegisterAllDetectors registers all framework detectors with the common package
Types ¶
type FrameworkIndicator ¶
type FrameworkIndicator struct {
Framework string // Framework identifier
Language string // Programming language
Indicators []string // File paths relative to project root
Description string // Human-readable description
}
FrameworkIndicator defines file paths that indicate a specific framework