scanner

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitError

type GitError struct {
	Err error
}

GitError indicates the path is not a git repository.

func (*GitError) Error

func (e *GitError) Error() string

func (*GitError) Unwrap

func (e *GitError) Unwrap() error

type Option

type Option func(*Service)

Option configures a Service.

func WithConfig

func WithConfig(cfg *config.Config) Option

WithConfig sets the configuration.

func WithOpener

func WithOpener(opener vcs.Opener) Option

WithOpener sets the VCS opener (for testing).

type PathError

type PathError struct {
	Path string
	Err  error
}

PathError indicates an invalid path.

func (*PathError) Error

func (e *PathError) Error() string

func (*PathError) Unwrap

func (e *PathError) Unwrap() error

type ScanError

type ScanError struct {
	Path string
	Err  error
}

ScanError indicates a scanning failure.

func (*ScanError) Error

func (e *ScanError) Error() string

func (*ScanError) Unwrap

func (e *ScanError) Unwrap() error

type ScanResult

type ScanResult struct {
	Files          []string
	LanguageGroups map[parser.Language][]string
	RepoRoot       string
}

ScanResult contains the result of a file scan.

type Service

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

Service provides file scanning functionality.

func New

func New(opts ...Option) *Service

New creates a new scanner service.

func (*Service) FilterBySize

func (s *Service) FilterBySize(files []string, maxSize int64) ([]string, int)

FilterBySize filters files by maximum size.

func (*Service) ScanPaths

func (s *Service) ScanPaths(paths []string) (*ScanResult, error)

ScanPaths scans multiple paths and returns all found source files.

func (*Service) ScanPathsForGit

func (s *Service) ScanPathsForGit(paths []string, gitRequired bool) (*ScanResult, error)

ScanPathsForGit scans paths and also resolves the git repository root. Returns an error if not in a git repository when gitRequired is true.

Jump to

Keyboard shortcuts

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