indexer

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2026 License: MIT Imports: 30 Imported by: 0

Documentation

Overview

Package indexer orchestrates the scan → extract → resolve → store pipeline.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	RepoRoot   string
	Index      *db.Index
	Verbose    bool
	Output     io.Writer
	Config     *config.Config
	OnProgress func(phase string, current, total int) // optional streaming callback
}

Config configures the indexer.

type Indexer

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

Indexer orchestrates the indexing pipeline.

func NewIndexer

func NewIndexer(cfg Config) (*Indexer, error)

NewIndexer creates an Indexer with all language extractors and resolvers.

func (*Indexer) Run

func (ix *Indexer) Run() error

Run executes the indexing pipeline, choosing full or incremental.

type ScannedFile

type ScannedFile struct {
	Path         string // repo-relative path
	AbsPath      string // absolute path
	ContentHash  string // SHA-256 hex digest
	Language     string // detected language
	LastModified int64  // Unix timestamp
	SizeBytes    int64
}

ScannedFile represents a discovered source file with its metadata.

type Scanner

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

Scanner discovers and hashes source files in a repository.

func NewScanner

func NewScanner(repoRoot string, configIgnore []string) *Scanner

NewScanner creates a Scanner for the given repository root. configIgnore is a list of path prefixes (with trailing slash) from config.

func (*Scanner) ScanAll

func (s *Scanner) ScanAll() ([]ScannedFile, error)

ScanAll walks the entire repository and returns all recognized source files.

func (*Scanner) ScanPaths

func (s *Scanner) ScanPaths(paths []string) ([]ScannedFile, error)

ScanPaths scans specific files and returns their metadata.

Jump to

Keyboard shortcuts

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