scanner

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package scanner finds files in a directory based on their extensions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindFiles added in v0.1.3

func FindFiles(root string, extensions []string) ([]string, error)

FindFiles walks a directory and returns all files matching the given extensions. Extensions should include the leading dot (e.g., ".md", ".json"). It skips hidden directories (starting with .) like .git.

func FindFilesByTypes added in v0.1.3

func FindFilesByTypes(root string, types []string) ([]string, error)

FindFilesByTypes walks a directory and returns all files matching the given type names. Type names are without the leading dot (e.g., "md", "json", "yaml"). It skips hidden directories (starting with .) like .git.

func FindFilesWithOptions added in v0.1.3

func FindFilesWithOptions(opts ScanOptions) ([]string, error)

FindFilesWithOptions scans for files with include/exclude filtering. This is the recommended function for scanning with full configuration support.

Types

type ScanOptions added in v0.1.3

type ScanOptions struct {
	// Root is the directory to scan.
	Root string

	// Types are the file types to include (e.g., "md", "json", "yaml").
	Types []string

	// Include patterns (glob) - if set, only matching files are included.
	Include []string

	// Exclude patterns (glob) - matching files are excluded.
	Exclude []string
}

ScanOptions holds options for scanning files with filtering.

Jump to

Keyboard shortcuts

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