Module connector_fs

Module connector_fs 

Source
Expand description

Filesystem connector.

Walks a local directory, applies glob include/exclude patterns, and produces SourceItems with filesystem metadata (modification time, file path).

§Configuration

[connectors.filesystem.docs]
root = "./docs"
include_globs = ["**/*.md", "**/*.txt"]
exclude_globs = ["**/drafts/**"]
follow_symlinks = false

§Default Excludes

The following directories are always excluded regardless of configuration:

  • **/.git/**
  • **/target/**
  • **/node_modules/**

§Output

Each file becomes a SourceItem with:

  • source: "filesystem:<name>" (e.g. "filesystem:docs")
  • source_id: relative path from root (e.g. "guides/deploy.md")
  • source_url: file:// URI
  • updated_at: filesystem modification time
  • body: file contents as UTF-8

Structs§

FilesystemConnector
A filesystem connector instance that implements the Connector trait.

Constants§

BINARY_EXTENSIONS 🔒
Binary file extensions that are read as bytes and extracted (spec §2.2).

Functions§

binary_content_type 🔒
Extension to MIME type per spec §4.1.
build_globset 🔒
Build a [GlobSet] from a list of glob pattern strings.
file_to_source_item 🔒
Convert a single file to a SourceItem, or None if the file should be skipped (spec §2.2).
scan_filesystem
Scan a local directory and produce SourceItems.