Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileFilter ¶
FileFilter type for file filtering.
func FilterIsCollecting ¶
func FilterIsCollecting() FileFilter
FilterIsCollecting returns a filter that matches files that are being collected.
func FilterIsListening ¶
func FilterIsListening() FileFilter
FilterIsListening returns a filter that matches files that are being listened to.
func FilterReadyToProcess ¶
func FilterReadyToProcess() FileFilter
FilterReadyToProcess returns a filter that matches files that are ready to process.
func FilterTime ¶
func FilterTime(startTime, endTime int64) FileFilter
FilterTime returns a filter that matches files that have intervals overlapping with the given time.
type FileState ¶
type FileState struct {
Size int64 `json:"size"`
StartTime int64 `json:"start_time,omitempty"`
EndTime int64 `json:"end_time,omitempty"`
Unsupported bool `json:"unsupported,omitempty"`
IsDir bool `json:"is_dir,omitempty"`
IsListening bool `json:"is_listening,omitempty"`
IsCollecting bool `json:"is_collecting,omitempty"`
ProcessState processState `json:"process_state,omitempty"`
TooOld bool `json:"too_old,omitempty"`
Pathname string `json:"-"` // Pathname is output only for the Files method
}
FileState represents the state of a file in the system.
type FileStateHandler ¶
type FileStateHandler interface {
// UpdateDirs updates the directories being monitored.
UpdateDirs(conf config.DefaultModConfConfig) error
// Files returns filename and filestate pairs that match the given filters.
Files(filters ...FileFilter) []FileState
// UpdateFilesProcessState updates the state of files that are ready to process.
// This should be called before processing files
UpdateFilesProcessState() error
// MarkProcessedFile updates the state of files that were ready to process
// to mark them as processed.
MarkProcessedFile(filename string) error
// GetFileHandler returns the handler for a given file path.
GetFileHandler(filePath string) file_handlers.Interface
}
FileStateHandler is the interface for the file state handler.
func New ¶
func New() (FileStateHandler, error)
New returns the singleton instance of fileStateHandler.
Click to show internal directories.
Click to hide internal directories.