indexer

package
v0.0.0-...-4388f4f Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsIndexRecent

func IsIndexRecent(indexPath string, maxAge time.Duration) bool

IsIndexRecent checks if an index file exists and was created recently

func SaveIndex

func SaveIndex(indexPath string, index *CodeIndex) error

SaveIndex saves the index to a file

Types

type CodeIndex

type CodeIndex struct {
	Files      map[string]FileSummary `json:"files"`
	CreatedAt  time.Time              `json:"created_at"`
	SourcePath string                 `json:"source_path"`
}

CodeIndex represents an index of code files with their summaries

func BuildCodeIndex

func BuildCodeIndex(sourcePath string, llm provider.Provider) (*CodeIndex, error)

BuildCodeIndex scans the source directory and generates summaries using LLM

func LoadIndex

func LoadIndex(indexPath string) (*CodeIndex, error)

LoadIndex loads an existing index from a file

func (*CodeIndex) Search

func (idx *CodeIndex) Search(query string, limit int) []FileSummary

Search finds files matching the query based on summary content

type FileSummary

type FileSummary struct {
	Path        string `json:"path"`
	Summary     string `json:"summary"`
	Size        int64  `json:"size"`
	LastIndexed string `json:"last_indexed"`
}

FileSummary contains metadata and summary for a source file

Jump to

Keyboard shortcuts

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