analyzer

package
v1.2.8-sp2 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: AGPL-3.0 Imports: 48 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AllMode ScanMode = 0
	PkgMode          = 1 << (iota - 1)
	LanguageMode
)
View Source
const (
	TypPythonPoetry TypAnalyzer = "python-poetry-lang"

	PoetryLockFile = "poetry.lock"
	PyProjectFile  = "pyproject.toml"
)
View Source
const (
	TypRustCargo TypAnalyzer = "cargo-lang"

	CargoLock = "Cargo.lock"
	CargoToml = "Cargo.toml"
)

Variables

This section is empty.

Functions

func DrawPackagesDOT

func DrawPackagesDOT(pkgs []*dxtypes.Package)

func IsExecutable

func IsExecutable(buf []byte) bool

func MergePackages

func MergePackages(pkgs []*dxtypes.Package) []*dxtypes.Package

func NewApkAnalyzer

func NewApkAnalyzer() *apkAnalyzer

func NewConanAnalyzer

func NewConanAnalyzer() *conanAnalyzer

func NewDpkgAnalyzer

func NewDpkgAnalyzer() *dpkgAnalyzer

func NewGoBinaryAnalyzer

func NewGoBinaryAnalyzer() *goBinaryAnalyzer

func NewGoModAnalyzer

func NewGoModAnalyzer() *goModAnalyzer

func NewJarParser

func NewJarParser(path string, size int64) types.Parser

func NewJavaGradleAnalyzer

func NewJavaGradleAnalyzer() *gradleAnalyzer

func NewJavaJarAnalyzer

func NewJavaJarAnalyzer() *jarAnalyzer

func NewJavaPomAnalyzer

func NewJavaPomAnalyzer() *pomAnalyzer

func NewNodeNpmAnalyzer

func NewNodeNpmAnalyzer() *npmAnalyzer

func NewNodePnpmAnalyzer

func NewNodePnpmAnalyzer() *pnpmAnalyzer

func NewNodeYarnAnalyzer

func NewNodeYarnAnalyzer() *yarnAnalyzer

func NewPHPComposerAnalyzer

func NewPHPComposerAnalyzer() *composerAnalyzer

func NewPythonPIPAnalyzer

func NewPythonPIPAnalyzer() *pythonPIPAnalyzer

func NewPythonPIPEnvAnalyzer

func NewPythonPIPEnvAnalyzer() *pythonPIPEnvAnalyzer

func NewPythonPackagingAnalyzer

func NewPythonPackagingAnalyzer() *pythonPackagingAnalyzer

func NewPythonPoetryAnalyzer

func NewPythonPoetryAnalyzer() *pythonPoetryAnalyzer

func NewRPMAnalyzer

func NewRPMAnalyzer() *rpmAnalyzer

func NewRubyBundlerAnalyzer

func NewRubyBundlerAnalyzer() *rubyBunlderAnalyzer

func NewRubyGemSpecAnalyzer

func NewRubyGemSpecAnalyzer() *rubyGemSpecAnalyzer

func NewRustCargoAnalyzer

func NewRustCargoAnalyzer() *cargoAnalyzer

func ParseLanguageConfiguration

func ParseLanguageConfiguration(fi FileInfo, parser godeptypes.Parser) ([]*dxtypes.Package, error)

func ReadBlock

func ReadBlock(r *bufio.Reader) ([]byte, error)

ReadBlock reads Analyzer data block from the underlying reader until Analyzer blank line is encountered.

func RegisterAnalyzer

func RegisterAnalyzer(typ TypAnalyzer, a Analyzer)

Types

type AnalyzeFileInfo

type AnalyzeFileInfo struct {
	Self FileInfo
	// matched file
	MatchedFileInfos map[string]FileInfo
}

type Analyzer

type Analyzer interface {
	Analyze(AnalyzeFileInfo) ([]*dxtypes.Package, error)
	Match(MatchInfo) int
}

func FilterAnalyzer

func FilterAnalyzer(mode ScanMode, usedAnalyzers []TypAnalyzer) []Analyzer

type AnalyzerGroup

type AnalyzerGroup struct {
	// contains filtered or unexported fields
}

func NewAnalyzerGroup

func NewAnalyzerGroup(numWorkers int, scanMode ScanMode, usedAnalyzers []TypAnalyzer) *AnalyzerGroup

func (*AnalyzerGroup) Analyze

func (ag *AnalyzerGroup) Analyze() error

func (*AnalyzerGroup) Clear

func (ag *AnalyzerGroup) Clear()

func (*AnalyzerGroup) Consume

func (ag *AnalyzerGroup) Consume(wg *sync.WaitGroup)

func (*AnalyzerGroup) Match

func (ag *AnalyzerGroup) Match(path string, fi fs.FileInfo, r io.Reader) error

func (*AnalyzerGroup) Packages

func (ag *AnalyzerGroup) Packages() []*dxtypes.Package

type FileInfo

type FileInfo struct {
	Path        string
	Analyzer    Analyzer
	LazyFile    *lazyfile.LazyFile
	MatchStatus int
}

type JarParser

type JarParser struct {
	// contains filtered or unexported fields
}

func (*JarParser) Parse

type JarProperties

type JarProperties struct {
	GroupID    string
	ArtifactID string
	Version    string
	FilePath   string // path to file containing these props
}

func (JarProperties) Library

func (p JarProperties) Library() types.Library

func (JarProperties) String

func (p JarProperties) String() string

func (JarProperties) Valid

func (p JarProperties) Valid() bool

type MatchInfo

type MatchInfo struct {
	// contains filtered or unexported fields
}

type ScanMode

type ScanMode int

type TypAnalyzer

type TypAnalyzer string
const (
	TypClangConan TypAnalyzer = "conan-lang"

	ConanLock = "conan.lock"
)
const (
	TypJavaPom TypAnalyzer = "pom-lang"

	MavenPom = "pom.xml"
)
const (
	TypNodeYarn TypAnalyzer = "yarm-lang"

	YarnLock = "yarn.lock"
)
const (
	TypRubyBundler TypAnalyzer = "ruby-bundler-lang"

	GemLock = "Gemfile.lock"
)
const (
	TypAPK TypAnalyzer = "apk-pkg"
)
const (
	TypDPKG TypAnalyzer = "dpkg-pkg"
)
const (
	TypGoBinary TypAnalyzer = "go-binary-lang"
)
const (
	TypGoMod TypAnalyzer = "go-mod-lang"
)
const (
	TypJavaGradle TypAnalyzer = "gradle-lang"
)
const (
	TypJavaJar TypAnalyzer = "jar-lang"
)
const (
	TypNodeNpm TypAnalyzer = "npm-lang"
)
const (
	TypNodePnpm TypAnalyzer = "npmp-lang"
)
const (
	TypPHPComposer TypAnalyzer = "composer-lang"
)
const (
	TypPythonPIP TypAnalyzer = "python-pip-lang"
)
const (
	TypPythonPIPEnv TypAnalyzer = "python-pipenv-lang"
)
const (
	TypPythonPackaging TypAnalyzer = "python-packaging-lang"
)
const (
	TypRPM TypAnalyzer = "rpm-pkg"
)
const (
	TypRubyGemSpec TypAnalyzer = "ruby-gemspec-lang"
)

Jump to

Keyboard shortcuts

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