Documentation
¶
Index ¶
- type Indexer
- func (idx *Indexer) GetAllDependencies() ([]*db.Dependency, error)
- func (idx *Indexer) GetAllEntities() ([]*db.Entity, error)
- func (idx *Indexer) GetAllFiles() ([]*db.File, error)
- func (idx *Indexer) GetAllRelations() ([]*db.EntityRelation, error)
- func (idx *Indexer) GetEntitiesByFile(fileID int64) ([]*db.Entity, error)
- func (idx *Indexer) GetEntityByID(id int64) (*db.Entity, error)
- func (idx *Indexer) GetEntityRelations(entityID int64, relType string) ([]*db.EntityRelation, error)
- func (idx *Indexer) GetFileByID(id int64) (*db.File, error)
- func (idx *Indexer) GetFileByPath(path string) (*db.File, error)
- func (idx *Indexer) GetStats() (map[string]interface{}, error)
- func (idx *Indexer) IndexDirectory(dirPath string) error
- func (idx *Indexer) IndexFile(filePath string) error
- func (idx *Indexer) QueryCallGraph(entityID int64) (map[string]interface{}, error)
- func (idx *Indexer) QueryDependencyGraph(filePath string) (map[string]interface{}, error)
- func (idx *Indexer) QueryEntity(name string) ([]*db.Entity, error)
- func (idx *Indexer) SetVerbose(v bool)
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 (*Indexer) GetAllDependencies ¶
func (idx *Indexer) GetAllDependencies() ([]*db.Dependency, error)
func (*Indexer) GetAllRelations ¶
func (idx *Indexer) GetAllRelations() ([]*db.EntityRelation, error)
func (*Indexer) GetEntitiesByFile ¶
func (*Indexer) GetEntityRelations ¶
func (*Indexer) IndexDirectory ¶
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 ¶
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 (*Indexer) QueryDependencyGraph ¶
func (*Indexer) SetVerbose ¶
SetVerbose enables detailed progress logging with emojis.