Documentation ¶
Overview ¶
Package enricher implements functions that detect the name and ports of a component. Uses three general strategies: Dockerfile, Compose, and Source. Dockerfile consists of using a dockerfile to extract information. Compose consists of using a compose file to extract information. Source consists of searching for specific statements of function invocations inside the source code.
Index ¶
- func GetDefaultProjectName(path string) string
- func GetPortsFromDockerComposeFile(componentPath string, settings model.DetectionSettings) []int
- func GetPortsFromDockerFile(root string) []int
- func IsConfigurationValidForLanguage(language string, file string) bool
- type DotNetEnricher
- func (d DotNetEnricher) DoEnrichComponent(component *model.Component, settings model.DetectionSettings, ...)
- func (d DotNetEnricher) DoEnrichLanguage(language *model.Language, files *[]string)
- func (d DotNetEnricher) GetSupportedLanguages() []string
- func (d DotNetEnricher) IsConfigValidForComponentDetection(language string, config string) bool
- type Enricher
- type FrameworkDetectorWithConfigFile
- type FrameworkDetectorWithoutConfigFile
- type GoEnricher
- func (g GoEnricher) DoEnrichComponent(component *model.Component, settings model.DetectionSettings, ...)
- func (g GoEnricher) DoEnrichLanguage(language *model.Language, files *[]string)
- func (g GoEnricher) GetSupportedLanguages() []string
- func (g GoEnricher) IsConfigValidForComponentDetection(language string, config string) bool
- type GoFrameworkDetector
- type JavaEnricher
- func (j JavaEnricher) DoEnrichComponent(component *model.Component, settings model.DetectionSettings, ...)
- func (j JavaEnricher) DoEnrichLanguage(language *model.Language, files *[]string)
- func (j JavaEnricher) GetSupportedLanguages() []string
- func (j JavaEnricher) IsConfigValidForComponentDetection(language string, config string) bool
- type JavaScriptEnricher
- func (j JavaScriptEnricher) DoEnrichComponent(component *model.Component, settings model.DetectionSettings, ...)
- func (j JavaScriptEnricher) DoEnrichLanguage(language *model.Language, files *[]string)
- func (j JavaScriptEnricher) GetSupportedLanguages() []string
- func (j JavaScriptEnricher) IsConfigValidForComponentDetection(language string, config string) bool
- type PHPEnricher
- func (p PHPEnricher) DoEnrichComponent(component *model.Component, settings model.DetectionSettings, ...)
- func (p PHPEnricher) DoEnrichLanguage(language *model.Language, files *[]string)
- func (p PHPEnricher) GetSupportedLanguages() []string
- func (p PHPEnricher) IsConfigValidForComponentDetection(language string, config string) bool
- type PythonEnricher
- func (p PythonEnricher) DoEnrichComponent(component *model.Component, settings model.DetectionSettings, ...)
- func (p PythonEnricher) DoEnrichLanguage(language *model.Language, files *[]string)
- func (p PythonEnricher) GetSupportedLanguages() []string
- func (p PythonEnricher) IsConfigValidForComponentDetection(language string, config string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDefaultProjectName ¶
func GetPortsFromDockerComposeFile ¶
func GetPortsFromDockerComposeFile(componentPath string, settings model.DetectionSettings) []int
GetPortsFromDockerComposeFile returns a slice of port numbers from a compose file.
func GetPortsFromDockerFile ¶
GetPortsFromDockerFile returns a slice of port numbers from Dockerfiles in the given directory.
func IsConfigurationValidForLanguage ¶
IsConfigurationValidForLanguage checks whether the file is valid for the language.
For example when analyzing a nodejs project, we could find a package.json within the node_modules folder. That is not to be considered valid for component detection.
Types ¶
type DotNetEnricher ¶
type DotNetEnricher struct{}
func (DotNetEnricher) DoEnrichComponent ¶
func (d DotNetEnricher) DoEnrichComponent(component *model.Component, settings model.DetectionSettings, ctx *context.Context)
DoEnrichComponent checks for the port number using a Dockerfile or Compose file
func (DotNetEnricher) DoEnrichLanguage ¶
func (d DotNetEnricher) DoEnrichLanguage(language *model.Language, files *[]string)
DoEnrichLanguage runs DoFrameworkDetection with found dot net project files. dot net project files: https://learn.microsoft.com/en-us/dotnet/core/project-sdk/overview#project-files
func (DotNetEnricher) GetSupportedLanguages ¶
func (d DotNetEnricher) GetSupportedLanguages() []string
func (DotNetEnricher) IsConfigValidForComponentDetection ¶
func (d DotNetEnricher) IsConfigValidForComponentDetection(language string, config string) bool
type Enricher ¶
type Enricher interface { GetSupportedLanguages() []string DoEnrichLanguage(language *model.Language, files *[]string) DoEnrichComponent(component *model.Component, settings model.DetectionSettings, ctx *context.Context) IsConfigValidForComponentDetection(language string, configFile string) bool }
func GetEnricherByLanguage ¶
GetEnricherByLanguage returns an enricher.
type GoEnricher ¶
type GoEnricher struct{}
func (GoEnricher) DoEnrichComponent ¶
func (g GoEnricher) DoEnrichComponent(component *model.Component, settings model.DetectionSettings, ctx *context.Context)
DoEnrichComponent checks for the port number using a Dockerfile, Compose file, or Source strategy
func (GoEnricher) DoEnrichLanguage ¶
func (g GoEnricher) DoEnrichLanguage(language *model.Language, files *[]string)
DoEnrichLanguage runs DoFrameworkDetection with found go project files. go project files: go.mod
func (GoEnricher) GetSupportedLanguages ¶
func (g GoEnricher) GetSupportedLanguages() []string
func (GoEnricher) IsConfigValidForComponentDetection ¶
func (g GoEnricher) IsConfigValidForComponentDetection(language string, config string) bool
type GoFrameworkDetector ¶
type JavaEnricher ¶
type JavaEnricher struct{}
func (JavaEnricher) DoEnrichComponent ¶
func (j JavaEnricher) DoEnrichComponent(component *model.Component, settings model.DetectionSettings, ctx *context.Context)
DoEnrichComponent checks for the port number using a Dockerfile, Compose file, or Source strategy
func (JavaEnricher) DoEnrichLanguage ¶
func (j JavaEnricher) DoEnrichLanguage(language *model.Language, files *[]string)
DoEnrichLanguage runs DoFrameworkDetection with found java project files. java project files: build.gradle, pom.xml, build.xml
func (JavaEnricher) GetSupportedLanguages ¶
func (j JavaEnricher) GetSupportedLanguages() []string
func (JavaEnricher) IsConfigValidForComponentDetection ¶
func (j JavaEnricher) IsConfigValidForComponentDetection(language string, config string) bool
type JavaScriptEnricher ¶
type JavaScriptEnricher struct{}
func (JavaScriptEnricher) DoEnrichComponent ¶
func (j JavaScriptEnricher) DoEnrichComponent(component *model.Component, settings model.DetectionSettings, ctx *context.Context)
DoEnrichComponent checks for the port number using a Dockerfile, Compose file, or Source strategy
func (JavaScriptEnricher) DoEnrichLanguage ¶
func (j JavaScriptEnricher) DoEnrichLanguage(language *model.Language, files *[]string)
DoEnrichLanguage runs DoFrameworkDetection with found javascript project files. javascript project files: package.json
func (JavaScriptEnricher) GetSupportedLanguages ¶
func (j JavaScriptEnricher) GetSupportedLanguages() []string
func (JavaScriptEnricher) IsConfigValidForComponentDetection ¶
func (j JavaScriptEnricher) IsConfigValidForComponentDetection(language string, config string) bool
type PHPEnricher ¶
type PHPEnricher struct{}
func (PHPEnricher) DoEnrichComponent ¶
func (p PHPEnricher) DoEnrichComponent(component *model.Component, settings model.DetectionSettings, ctx *context.Context)
DoEnrichComponent checks for the port number using a Dockerfile, Compose file, or Source strategy
func (PHPEnricher) DoEnrichLanguage ¶
func (p PHPEnricher) DoEnrichLanguage(language *model.Language, files *[]string)
DoEnrichLanguage runs DoFrameworkDetection with found php project files. php project files: composer.json
func (PHPEnricher) GetSupportedLanguages ¶
func (p PHPEnricher) GetSupportedLanguages() []string
func (PHPEnricher) IsConfigValidForComponentDetection ¶
func (p PHPEnricher) IsConfigValidForComponentDetection(language string, config string) bool
type PythonEnricher ¶
type PythonEnricher struct{}
func (PythonEnricher) DoEnrichComponent ¶
func (p PythonEnricher) DoEnrichComponent(component *model.Component, settings model.DetectionSettings, ctx *context.Context)
DoEnrichComponent checks for the port number using a Dockerfile, Compose file, or Source strategy
func (PythonEnricher) DoEnrichLanguage ¶
func (p PythonEnricher) DoEnrichLanguage(language *model.Language, files *[]string)
DoEnrichLanguage runs DoFrameworkDetection with files. No specific file is targeted, will use everything in files.
func (PythonEnricher) GetSupportedLanguages ¶
func (p PythonEnricher) GetSupportedLanguages() []string
func (PythonEnricher) IsConfigValidForComponentDetection ¶
func (p PythonEnricher) IsConfigValidForComponentDetection(language string, config string) bool