indexer

package
v0.0.0-alpha.11 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Indexer

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

Indexer builds and queries the code graph.

func New

func New(database *db.Database) *Indexer

func (*Indexer) GetAllDependencies

func (idx *Indexer) GetAllDependencies() ([]*db.Dependency, error)

func (*Indexer) GetAllEntities

func (idx *Indexer) GetAllEntities() ([]*db.Entity, error)

func (*Indexer) GetAllFiles

func (idx *Indexer) GetAllFiles() ([]*db.File, error)

func (*Indexer) GetAllRelations

func (idx *Indexer) GetAllRelations() ([]*db.EntityRelation, error)

func (*Indexer) GetEntitiesByFile

func (idx *Indexer) GetEntitiesByFile(fileID int64) ([]*db.Entity, error)

func (*Indexer) GetEntityByID

func (idx *Indexer) GetEntityByID(id int64) (*db.Entity, error)

func (*Indexer) GetEntityRelations

func (idx *Indexer) GetEntityRelations(entityID int64, relType string) ([]*db.EntityRelation, error)

func (*Indexer) GetFileByID

func (idx *Indexer) GetFileByID(id int64) (*db.File, error)

func (*Indexer) GetFileByPath

func (idx *Indexer) GetFileByPath(path string) (*db.File, error)

func (*Indexer) GetStats

func (idx *Indexer) GetStats() (map[string]interface{}, error)

func (*Indexer) IndexDirectory

func (idx *Indexer) IndexDirectory(dirPath string) error

IndexDirectory recursively indexes all source files in a directory using a goroutine worker pool (one worker per CPU core) for parallel parsing.

It respects .gitignore and .ignore files found at any level of the tree.

func (*Indexer) IndexFile

func (idx *Indexer) IndexFile(filePath string) error

IndexFile parses a single file and upserts all its entities, dependencies, and entity relations into the database.

If the file has not changed since the last index run (hash is identical) it is skipped. If the file has changed, existing entities and dependencies are deleted before re-inserting so the graph stays consistent.

This method is safe to call from multiple goroutines concurrently.

func (*Indexer) QueryCallGraph

func (idx *Indexer) QueryCallGraph(entityID int64) (map[string]interface{}, error)

func (*Indexer) QueryDependencyGraph

func (idx *Indexer) QueryDependencyGraph(filePath string) (map[string]interface{}, error)

func (*Indexer) QueryEntity

func (idx *Indexer) QueryEntity(name string) ([]*db.Entity, error)

func (*Indexer) SetVerbose

func (idx *Indexer) SetVerbose(v bool)

SetVerbose enables detailed progress logging with emojis.

Jump to

Keyboard shortcuts

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