discovery

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package discovery finds Markdown files by expanding glob patterns from config.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Discover

func Discover(opts Options) ([]string, error)

Discover walks BaseDir and returns files matching any of the configured glob patterns. Results are deduplicated and sorted.

Types

type Options

type Options struct {
	// Patterns is the list of glob patterns to match files against.
	// An empty or nil list means no files are discovered.
	Patterns []string

	// BaseDir is the directory to walk from. Defaults to "." if empty.
	BaseDir string

	// UseGitignore enables filtering by .gitignore rules.
	UseGitignore bool

	// FollowSymlinks opts in to including symlinks that resolve
	// to regular files. The zero value skips all symlinks, which
	// is the secure default.
	//
	// Symlinks resolving to anything other than a regular file
	// (directories, FIFOs, devices, sockets) are always skipped.
	// filepath.Walk is Lstat-based, so symlinked directories are
	// never descended into regardless of this flag.
	FollowSymlinks bool
}

Options controls how file discovery behaves.

Jump to

Keyboard shortcuts

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