code

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ReaderRepository added in v1.9.2

type ReaderRepository interface {
	GetDependencyUsageEvidencesByPackageName(context.Context, string) ([]*ent.DepsUsageEvidence, error)
}

Repository exposed to rest of the vet to query code analysis data persisted in the storage. This is a contract to the rest of the system

func NewReaderRepository added in v1.9.2

func NewReaderRepository(client *ent.Client) (ReaderRepository, error)

type Scanner added in v1.9.2

type Scanner interface {
	Scan(context.Context) error
}

Scanner defines the contract for implementing a code scanner. The purpose of code scanner is to scan configured directories for code files, parse them, process them with plugins, persist the plugin results. It should also expose the necessary callbacks for interactive applications to show progress to user.

func NewScanner added in v1.9.2

func NewScanner(config ScannerConfig, storage storage.Storage[*ent.Client]) (Scanner, error)

type ScannerCallbackRegistry added in v1.9.2

type ScannerCallbackRegistry struct {
	// On start of scan
	OnScanStart func() error

	// On end of scan
	OnScanEnd func() error
}

type ScannerConfig added in v1.9.2

type ScannerConfig struct {
	// First party application code directories
	AppDirectories []string

	// 3rd party imported code directories (e.g. Python virtual env, `node_modules` etc.)
	ImportDirectories []string

	// Regular expressions to exclude files or directories
	// from traversal
	ExcludePatterns []*regexp.Regexp

	// Languages to scan
	Languages []core.Language

	// Define callbacks if required
	Callbacks *ScannerCallbackRegistry

	// Plugin specific configuration
	SkipDependencyUsagePlugin bool
}

User define configuration for the scanner

Jump to

Keyboard shortcuts

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