Documentation
¶
Overview ¶
Package scanner provides local git repository discovery and scanning.
This package finds git repositories in a directory tree by detecting .git directories. It supports configurable scan depth and filtering.
Usage ¶
repos, err := scanner.Scan("/path/to/workspace", scanner.Options{
MaxDepth: 2,
Exclude: []string{"vendor", "node_modules"},
})
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToRepositories ¶
func ToRepositories(scanned []*ScannedRepo) []*provider.Repository
ToRepositories converts ScannedRepos to provider.Repository format.
Types ¶
type GitRepoScanner ¶
type GitRepoScanner struct {
RootPath string
MaxDepth int
RespectGitIgnore bool
ExcludePatterns []string
IncludePatterns []string
}
GitRepoScanner scans directories for git repositories.
func (*GitRepoScanner) Scan ¶
func (s *GitRepoScanner) Scan(ctx context.Context) ([]*ScannedRepo, error)
Scan discovers all git repositories under RootPath.
type ScannedRepo ¶
type ScannedRepo struct {
Name string
Path string
Remotes map[string]string // Remote name -> URL (e.g., "origin" -> "git@github.com:user/repo.git")
Depth int // Depth from root
Branch string // Current branch name (empty if detached or unknown)
}
ScannedRepo represents a discovered git repository.
Click to show internal directories.
Click to hide internal directories.