source

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package source defines where documents come from. A Source lists and reads files; the indexer decides what changed. Watch support is a separate optional interface so poll-only sources (git) stay simple.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileMeta

type FileMeta struct {
	RelPath   string
	SizeBytes int64
	MtimeUnix int64
}

FileMeta is a cheap listing entry, used for incremental sync before any content is read.

type Source

type Source interface {
	Name() string
	// Sync brings the local view up to date (git: fetch+reset; localdir: no-op).
	Sync(ctx context.Context) error
	List(ctx context.Context) ([]FileMeta, error)
	Read(ctx context.Context, relPath string) (io.ReadCloser, error)
	// URI renders the canonical identifier for a file (file://..., git remote).
	URI(relPath string) string
}

Source is one ingestion pipeline's origin. List returns only indexable files: sources filter by include/exclude globs and the extractor extension allowlist, so nothing unindexable ever reaches a manifest.

type Watchable

type Watchable interface {
	Watch(ctx context.Context, dirty chan<- string) error
}

Watchable is implemented by sources that can push change notifications. The value sent on dirty is the rel path that changed; an empty string means "unknown, rescan everything".

Directories

Path Synopsis
Package gitrepo is the git source: a repository shallow-cloned into a cache directory and kept fresh by polling.
Package gitrepo is the git source: a repository shallow-cloned into a cache directory and kept fresh by polling.
Package localdir is the filesystem source: a directory walked (and later watched) for indexable files.
Package localdir is the filesystem source: a directory walked (and later watched) for indexable files.
Package s3 is the object-storage source: an S3 or S3-compatible bucket (MinIO, Ceph RGW) listed by poll and read on demand.
Package s3 is the object-storage source: an S3 or S3-compatible bucket (MinIO, Ceph RGW) listed by poll and read on demand.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL