Documentation ¶
Index ¶
- Variables
- func Get(ctx context.Context, dataDir, indexDataDir, projectName string, ...) (map[string]schema.Index, error)
- func IndexDir(ctx context.Context, dir string) (map[string]*schema.Index, error)
- func IndexForSearch(projectName, indexDataDir string, indexes map[string]*schema.Index) error
- func List(indexDataDir string) ([]string, error)
- func ReadAutoIndex(path string) (map[string]AutoIndexedProject, error)
- func Register(indexer Language)
- func RunIndexers(ctx context.Context, dir, dataDir, projectName string) error
- func WriteAutoIndex(path string, autoindexedProjects map[string]AutoIndexedProject) error
- func WriteIndexes(projectName string, indexDataDir string, indexes map[string]*schema.Index) error
- type AutoIndexedProject
- type Language
- type Result
Constants ¶
This section is empty.
Variables ¶
var Registered = map[string]Language{}
Registered indexers by language ID ("go", "objc", "cpp", etc.)
Functions ¶
func Get ¶
func Get(ctx context.Context, dataDir, indexDataDir, projectName string, autoCloneMissing bool) (map[string]schema.Index, error)
Get gets all the language indexes for the specified project.
When autoCloneMissing is true, if the project does not exist the server will attempt to `git clone <projectName> and index it. Beware, this may not be safe to enable if you have Git configured to access private repositories and the server is public!
func IndexDir ¶
IndexDir indexes the specified directory recursively. It looks at the file extension of every file, and then asks the registered indexers for each language to index.
Returns the successful indexes and any errors.
func IndexForSearch ¶
IndexForSearch produces search indexes for the given project, writing them to:
index/<project_name>/search-index.sinter
func ReadAutoIndex ¶
func ReadAutoIndex(path string) (map[string]AutoIndexedProject, error)
Read autoindexedProjects array from the provided filepath.
func RunIndexers ¶
Runs all the registered language indexes along with the search indexer and stores the results.
If an error is returned, it may be the case that some indexers succeeded while others failed.
func WriteAutoIndex ¶
func WriteAutoIndex(path string, autoindexedProjects map[string]AutoIndexedProject) error
Write autoindexedProjects as JSON in the provided filepath.
Types ¶
type AutoIndexedProject ¶
type AutoIndexedProject struct { // Name of the project to be auto-indexed Name string `json:"name"` }
type Language ¶
type Language interface { // Name of the language this indexer works for. Name() schema.Language // Extensions returns a list of file extensions commonly associated with the language. Extensions() []string // IndexDir indexes a directory of code likely to contain sources in this language recursively. IndexDir(ctx context.Context, dir string) (*schema.Index, error) }
Language describes an indexer for a specific language.
Directories ¶
Path | Synopsis |
---|---|
Package golang provides a doctree indexer implementation for Go.
|
Package golang provides a doctree indexer implementation for Go. |
Package markdown provides a doctree indexer implementation for Markdown.
|
Package markdown provides a doctree indexer implementation for Markdown. |
Package python provides a doctree indexer implementation for Python.
|
Package python provides a doctree indexer implementation for Python. |
Package zig provides a doctree indexer implementation for Zig.
|
Package zig provides a doctree indexer implementation for Zig. |