scanner

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: MIT Imports: 7 Imported by: 0

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.

Jump to

Keyboard shortcuts

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