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) (indexOp, 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) SetMaxFileSize(bytes int64)
- 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. It returns the operation performed so callers can track add/update/skip counts.
func (*Indexer) QueryCallGraph ¶
func (*Indexer) QueryDependencyGraph ¶
func (*Indexer) SetMaxFileSize ¶
SetMaxFileSize sets the maximum file size in bytes that will be fully parsed. Files larger than this will have metadata recorded but no entity extraction. 0 disables the limit (original behaviour).
func (*Indexer) SetVerbose ¶
SetVerbose enables detailed progress logging with emojis.