Documentation ¶
Overview ¶
Package detectors exposes functions to register and use container information extractors.
Index ¶
- func DetectOS(data map[string][]byte) string
- func DetectPackages(data map[string][]byte) ([]*database.Package, error)
- func GetRequiredFilesOS() (files []string)
- func GetRequiredFilesPackages() (files []string)
- func RegisterOSDetector(name string, f OSDetector)
- func RegisterPackagesDetector(name string, f PackagesDetector)
- type OSDetector
- type PackagesDetector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectPackages ¶
DetectPackages detects packages using every registered PackagesDetector
func GetRequiredFilesOS ¶
func GetRequiredFilesOS() (files []string)
GetRequiredFilesOS returns the list of files required for Detect for every registered OSDetector, without leading /
func GetRequiredFilesPackages ¶
func GetRequiredFilesPackages() (files []string)
GetRequiredFilesPackages returns the list of files required for Detect for every registered PackagesDetector, without leading /
func RegisterOSDetector ¶
func RegisterOSDetector(name string, f OSDetector)
RegisterOSDetector provides a way to dynamically register an implementation of a OSDetector.
If RegisterOSDetector is called twice with the same name if OSDetector is nil, or if the name is blank, it panics.
func RegisterPackagesDetector ¶
func RegisterPackagesDetector(name string, f PackagesDetector)
RegisterPackagesDetector makes a PackagesDetector available for DetectPackages
Types ¶
type OSDetector ¶
type OSDetector interface { // Detect detects an Operating System and its version from input data Detect(map[string][]byte) (string, string) // GetRequiredFiles returns the list of files required for Detect, without // leading / GetRequiredFiles() []string }
The OSDetector interface defines a way to detect an Operating System and its version from input data
type PackagesDetector ¶
type PackagesDetector interface { // Detect detects packages from the input data Detect(map[string][]byte) ([]*database.Package, error) // GetRequiredFiles returns the list of files required for Detect, without // leading / GetRequiredFiles() []string }
The PackagesDetector interface defines a way to detect packages from input data