providers

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAll

func GetAll() map[string]*PackageProvider

GetAll returns all registered providers

func GroupArtifactExtractor

func GroupArtifactExtractor(techKey string) func(*types.Payload) []string

GroupArtifactExtractor creates an ExtractPackageNames function that extracts groupId:artifactId from component.Properties[techKey]

func Register

func Register(provider *PackageProvider)

Register allows detectors to register their package extraction and matching logic

func SinglePropertyExtractor

func SinglePropertyExtractor(techKey, propName string) func(*types.Payload) []string

SinglePropertyExtractor creates an ExtractPackageNames function that extracts a single property from component.Properties[techKey][propName]

Types

type PackageProvider

type PackageProvider struct {
	DependencyType      string                                                    // "nuget", "npm", "maven", etc.
	ExtractPackageNames func(component *types.Payload) []string                   // Extract package names from properties
	MatchFunc           func(componentPkgName string, dependencyName string) bool // Custom matching logic (e.g., case-insensitive)
}

PackageProvider defines how a detector extracts and matches packages

func Get

func Get(dependencyType string) *PackageProvider

Get returns a registered package provider by dependency type

Jump to

Keyboard shortcuts

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