Documentation
¶
Index ¶
- func CloneOrFetch(url, repoPath string) (*git.Repository, error)
- func IndexLocalRepo(ctx context.Context, s *store.Store, localPath string, opts IndexOptions) error
- func IndexRepo(ctx context.Context, s *store.Store, url string, opts IndexOptions) error
- func RepoDirFromURL(url string) (string, error)
- func RepoNameFromURL(url string) (string, error)
- type BleveCodeDoc
- type BleveDiffDoc
- type IndexOptions
- type ParseStats
- type ProgressFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloneOrFetch ¶
func CloneOrFetch(url, repoPath string) (*git.Repository, error)
CloneOrFetch clones a bare repo at repoPath, or fetches if it already exists. Returns the opened go-git Repository.
func IndexLocalRepo ¶
IndexLocalRepo indexes a local git repository in-place (no clone). It indexes all committed history AND the current working tree, including uncommitted (dirty) files.
func RepoDirFromURL ¶
RepoDirFromURL derives a local directory name from a repo URL. "https://github.com/user/repo/" -> "github.com/user/repo.git"
func RepoNameFromURL ¶
RepoNameFromURL derives a human-readable name from a URL. "https://github.com/user/repo" -> "github.com/user/repo"
Types ¶
type BleveCodeDoc ¶
type BleveCodeDoc struct {
Content string `json:"content"`
}
BleveCodeDoc is the document indexed into the code Bleve index.
type BleveDiffDoc ¶
type BleveDiffDoc struct {
Content string `json:"content"`
}
BleveDiffDoc is the document indexed into the diff Bleve index.
type IndexOptions ¶
type IndexOptions struct {
MaxHistoryDepth int // 0 = unlimited
Progress ProgressFunc
SkipDirs map[string]bool // directories to skip in worktree indexing; nil = use defaultSkipDirs
}
IndexOptions configures the indexing process.
type ParseStats ¶
ParseStats holds statistics from the symbol parsing phase.
func ParseSymbols ¶
func ParseSymbols(ctx context.Context, s *store.Store, progress ProgressFunc) (ParseStats, error)
ParseSymbols extracts symbols and references from all unparsed blobs with supported languages and inserts them into the symbols and symbol_refs tables.
type ProgressFunc ¶
type ProgressFunc func(msg string)
ProgressFunc is called with status messages during indexing.