Documentation
¶
Overview ¶
Package project orchestrates content acquisition and search indexing for the mcpsmithy sources system.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Build ¶
func Build(ctx context.Context, cfg *config.Config, projectRoot string, opts BuildOptions) (search.Searcher, <-chan struct{})
Build processes all sources according to cfg and opts, returning a Searcher and a channel that closes when initial processing completes. Each source is fetched (if remote and policy permits) then indexed (unless opts.SkipIndex or the source has index: false).
Modes:
- SkipIndex=true: fetch only, no indexing, blocks until complete (used by "sources pull")
- otherwise: indexing runs in background; if syncInterval>0 a refresh loop re-runs every N minutes
Pull policies (applied per-source, falling back to global):
- always: re-fetch on every startup and refresh
- ifNotPresent: skip fetch if source directory already exists (default)
- never: never fetch, only use sources already on disk
Types ¶
type BuildOptions ¶
type BuildOptions struct {
// SkipIndex skips building the search index; only fetches remote sources
// to disk. Used by the "sources pull" CLI command.
SkipIndex bool
// Registry overrides the source factory registry. When nil the
// default registry (populated by init) is used. Tests can pass
// a cloned registry to inject fakes without mutating globals.
Registry *sources.Registry
}
BuildOptions configures the behaviour of Build.
Click to show internal directories.
Click to hide internal directories.