Documentation
¶
Overview ¶
Package filewatch provides shared file discovery for agentwatch sources. It handles directory walking with glob pattern filters, age-window filtering, and efficient re-scanning by tracking directory modification times.
Sources (claude, codex, gemini) use Walker in their Discover() implementations. Keep this package internal until a custom source author demonstrably needs it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Walker)
Option configures a Walker.
func WithClock ¶
WithClock injects a clock function used to evaluate age windows. Intended for testing; production callers should omit this option.
func WithFollowSymlinks ¶
WithFollowSymlinks controls whether symlinks that point to directories are followed during the walk. Symlinks pointing to regular files are always followed. The default is false.
func WithMaxAge ¶
WithMaxAge limits discovery to files whose modification time is within d of the current time. A zero duration (the default) disables age filtering.
func WithPattern ¶
WithPattern adds a glob pattern that file names must match (e.g. "*.jsonl"). Multiple patterns are ORed: a file matching any pattern is included. If no pattern is added, all files are included.
type Walker ¶
type Walker struct {
// contains filtered or unexported fields
}
Walker walks one or more directory trees and returns files that satisfy the configured filters. Repeated calls to Discover skip directories whose modification time has not changed since the previous scan.