Documentation
¶
Overview ¶
Package domain implements the core business logic of the application.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidDirPath indicates that the provided directory path is invalid. ErrInvalidDirPath = errors.New("invalid directory path") // ErrFileOperation indicates a failure during file operations. ErrFileOperation = errors.New("file operation failed") // ErrTokenization indicates a failure during tokenization. ErrTextProcessing = errors.New("text processing failed") // ErrEmptyDir indicates that no eligible files were found in the specified // directory. ErrEmptyDir = errors.New("no eligible files found in directory") // ErrTooManyErrors indicates that too many errors occurred during directory // processing, leading to an abort. ErrTooManyErrors = errors.New("too many errors during directory processing") // ErrNoTokensFound indicates that no tokens were found after processing the // files in the specified directory. ErrNoTokensFound = errors.New("no tokens found in directory") )
Functions ¶
func ProcessDirectory ¶
ProcessDirectory tokenizes all eligible files in the specified directory and stores the tokens in the database. It returns an error if a set number of errors occur during processing.
Types ¶
type FileStatus ¶
type FileStatus int
FileStatus represents the status of a file with respect to the database.
const ( // FileStatusUnchanged indicates the file is unchanged since last // tokenization. FileStatusUnchanged FileStatus = iota // FileStatusChanged indicates the file has changed since last tokenization. FileStatusChanged // FileStatusNew indicates the file is new and not present in the database. FileStatusNew // FileStatusIneligible indicates the file is ineligible for tokenization. FileStatusIneligible )
Click to show internal directories.
Click to hide internal directories.