Documentation
¶
Index ¶
- Constants
- type FileInfo
- type Tracker
- func (t *Tracker) Clear()
- func (t *Tracker) Count() int
- func (t *Tracker) GetLastIndexed() time.Time
- func (t *Tracker) GetStaleFiles(stalenessThreshold time.Duration) []string
- func (t *Tracker) IsIndexed(path string) bool
- func (t *Tracker) MarkIndexed(path string) error
- func (t *Tracker) MarkIndexedBatch(paths []string) error
- func (t *Tracker) RemoveFile(path string)
- func (t *Tracker) RemoveFiles(paths []string)
- func (t *Tracker) Save() error
- func (t *Tracker) TrackedPaths() []string
Constants ¶
const (
// TrackerFileName is the name of the file tracking data file
TrackerFileName = "file_tracker.json"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileInfo ¶
type FileInfo struct {
MtimeAtIndex time.Time `json:"mtime_at_index"`
IndexedAt time.Time `json:"indexed_at"`
}
FileInfo stores indexing metadata for a file
type Tracker ¶
type Tracker struct {
// contains filtered or unexported fields
}
Tracker tracks file modification times to detect stale indexed files
func NewTracker ¶
NewTracker creates a new file tracker
func (*Tracker) GetLastIndexed ¶ added in v0.57.1
GetLastIndexed returns when the index was last updated
func (*Tracker) GetStaleFiles ¶
GetStaleFiles returns files that have been modified since indexing and whose modifications are older than the staleness threshold. This prevents reindexing files that are actively being edited.
func (*Tracker) MarkIndexed ¶
MarkIndexed records that a file was indexed with its current mtime
func (*Tracker) MarkIndexedBatch ¶
MarkIndexedBatch records multiple files as indexed
func (*Tracker) RemoveFile ¶
RemoveFile removes a file from tracking
func (*Tracker) RemoveFiles ¶
RemoveFiles removes multiple files from tracking
func (*Tracker) TrackedPaths ¶
TrackedPaths returns all tracked file paths