Documentation
¶
Index ¶
- func GetDefaultReplayDir() string
- func HasReplayFiles(rootDir string) (bool, error)
- func ResolveDefaultReplayDir() (string, error)
- func SortFilesByModTime(files []FileInfo)
- func ValidateReplayDir(rootDir string) error
- type FileInfo
- func FilterFilesByDate(files []FileInfo, upToDate *time.Time, upToMonths *int) []FileInfo
- func GetReplayFiles(rootDir string) ([]FileInfo, error)
- func HashFiles(ctx context.Context, files []FileInfo) ([]FileInfo, error)
- func LimitFiles(files []FileInfo, limit int) []FileInfo
- func NewFileInfoFromPath(filePath string) (*FileInfo, error)
- func WalkReplayFiles(rootDir string) ([]FileInfo, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDefaultReplayDir ¶
func GetDefaultReplayDir() string
GetDefaultReplayDir returns the default replay directory
func HasReplayFiles ¶
func ResolveDefaultReplayDir ¶
func SortFilesByModTime ¶
func SortFilesByModTime(files []FileInfo)
SortFilesByModTime sorts files by modification time (newest first)
func ValidateReplayDir ¶
Types ¶
type FileInfo ¶
FileInfo represents a replay file with metadata
func FilterFilesByDate ¶
FilterFilesByDate filters files by date constraints
func GetReplayFiles ¶
GetReplayFiles recursively finds all .rep files and computes SHA256 for each. Equivalent to WalkReplayFiles followed by HashFiles. Kept for callers that need both results in one shot (tests, benchmarks). Hot ingest paths should prefer the split form so checksum work can be skipped for files already known to the database.
func HashFiles ¶
HashFiles computes SHA256 for every entry whose Checksum is empty, fanning the work out across runtime.GOMAXPROCS goroutines. Already-hashed entries are passed through untouched. Cancellation via ctx aborts in-flight workers.
func LimitFiles ¶
LimitFiles limits the number of files returned
func NewFileInfoFromPath ¶
NewFileInfoFromPath stats the path and computes its checksum, returning a FileInfo shaped like one produced by GetReplayFiles. Used by paths that already know which .rep file to ingest (e.g. bulk re-analyze) and don't want to walk a directory.
func WalkReplayFiles ¶
WalkReplayFiles recursively finds all .rep files in the given directory and returns FileInfo entries with Path/Name/Size/ModTime populated. Checksum is left empty — callers that need it should use HashFiles to populate it for the subset that survives a cheaper dedup step (e.g. path-based prefilter).