Documentation
¶
Index ¶
- type FileChangeCallback
- type FileGroup
- func (fg *FileGroup) AddCallback(callback FileChangeCallback)
- func (fg *FileGroup) HandleEvent(event fsnotify.Event)
- func (fg *FileGroup) List() ([]string, error)
- func (fg *FileGroup) ListMatchingDirectories() (map[string]bool, error)
- func (fg *FileGroup) Match(path string) bool
- func (fg *FileGroup) RemoveCallback(callbackToRemove FileChangeCallback) bool
- type FileMonitor
- func (fm *FileMonitor) AddGroup(group *FileGroup) error
- func (fm *FileMonitor) CreateGroup(id, rootDir, pattern string, blacklist []string) (*FileGroup, error)
- func (fm *FileMonitor) GetGroup(id string) (*FileGroup, bool)
- func (fm *FileMonitor) GetGroups() []*FileGroup
- func (fm *FileMonitor) IsRunning() bool
- func (fm *FileMonitor) RefreshWatches() error
- func (fm *FileMonitor) RemoveGroup(id string) error
- func (fm *FileMonitor) SetBlacklist(blacklist []string)
- func (fm *FileMonitor) Start() error
- func (fm *FileMonitor) Stop() error
- func (fm *FileMonitor) Watcher() *fsnotify.Watcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileChangeCallback ¶
FileChangeCallback defines the callback function signature for file change events
type FileGroup ¶
type FileGroup struct {
ID string // Unique identifier
RootDir string // Root directory
Pattern *regexp.Regexp // File matching pattern
PatternStr string // Original pattern string for rebuilding
Blacklist []string // Blacklist patterns
Callbacks []FileChangeCallback // File change callbacks
// contains filtered or unexported fields
}
FileGroup represents a group of files with the same processing logic
func NewFileGroup ¶
NewFileGroup creates a new file group
func (*FileGroup) AddCallback ¶
func (fg *FileGroup) AddCallback(callback FileChangeCallback)
AddCallback adds a callback function to the file group
func (*FileGroup) HandleEvent ¶
HandleEvent processes a file event and triggers callbacks if the file matches
func (*FileGroup) ListMatchingDirectories ¶
ListMatchingDirectories returns directories containing matching files
func (*FileGroup) RemoveCallback ¶
func (fg *FileGroup) RemoveCallback(callbackToRemove FileChangeCallback) bool
RemoveCallback removes a callback function from the file group
type FileMonitor ¶
type FileMonitor struct {
// contains filtered or unexported fields
}
FileMonitor manages multiple file groups
func (*FileMonitor) AddGroup ¶
func (fm *FileMonitor) AddGroup(group *FileGroup) error
AddGroup adds a new file group
func (*FileMonitor) CreateGroup ¶
func (fm *FileMonitor) CreateGroup(id, rootDir, pattern string, blacklist []string) (*FileGroup, error)
CreateGroup creates and adds a new file group (convenience method)
func (*FileMonitor) GetGroup ¶
func (fm *FileMonitor) GetGroup(id string) (*FileGroup, bool)
GetGroup returns the specified file group
func (*FileMonitor) GetGroups ¶
func (fm *FileMonitor) GetGroups() []*FileGroup
GetGroups returns a list of all file group IDs
func (*FileMonitor) IsRunning ¶
func (fm *FileMonitor) IsRunning() bool
IsRunning returns whether the file monitor is running
func (*FileMonitor) RefreshWatches ¶
func (fm *FileMonitor) RefreshWatches() error
RefreshWatches updates the watched directories based on current matching files
func (*FileMonitor) RemoveGroup ¶
func (fm *FileMonitor) RemoveGroup(id string) error
RemoveGroup removes a file group
func (*FileMonitor) SetBlacklist ¶
func (fm *FileMonitor) SetBlacklist(blacklist []string)
SetBlacklist sets the global directory blacklist
func (*FileMonitor) Watcher ¶
func (fm *FileMonitor) Watcher() *fsnotify.Watcher