scanner

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package scanner discovers git repositories under a projects directory, respecting .katazuke index files for grouping and ignoring subdirectories.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsExcluded added in v0.2.0

func IsExcluded(name string, patterns []string) bool

IsExcluded returns true if the given name matches any of the glob patterns.

func Scan

func Scan(rootPath string, opts Options) ([]string, error)

Scan discovers git repositories under rootPath.

The algorithm:

  1. If a .katazuke file exists in a directory, parse it for groups/ignores and recurse into group subdirectories.
  2. If no .katazuke file exists, treat all immediate children as potential repositories.
  3. Hidden directories (starting with ".") are always skipped.
  4. Symlink cycles are detected via visited-path tracking.

func ToSet added in v0.2.0

func ToSet(items []string) map[string]bool

ToSet converts a string slice to a set (map with bool values).

Types

type IndexFile added in v0.2.0

type IndexFile struct {
	Groups  []string `yaml:"groups"`
	Ignores []string `yaml:"ignores"`
}

IndexFile represents the schema of a .katazuke index file.

func LoadIndex added in v0.2.0

func LoadIndex(dir string) (IndexFile, bool, error)

LoadIndex loads and validates a .katazuke file from the given directory. Returns the parsed index, whether the file existed, and any error.

type Options

type Options struct {
	ExcludePatterns []string
}

Options controls scanning behavior.

Jump to

Keyboard shortcuts

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