package fs // CatFile is for reading a whole file. type CatFile struct { readFile } // NewCatFile returns a new file catter. func NewCatFile(filePath string, globID string, serverMessages chan<- string, maxLineLength int) CatFile { return CatFile{ readFile: readFile{ filePath: filePath, globID: globID, serverMessages: serverMessages, retry: false, canSkipLines: false, seekEOF: false, maxLineLength: maxLineLength, }, } } // NewValidatedCatFile returns a new file catter backed by a rooted open target. func NewValidatedCatFile(filePath string, target ValidatedReadTarget, globID string, serverMessages chan<- string, maxLineLength int) CatFile { cat := NewCatFile(filePath, globID, serverMessages, maxLineLength) cat.readFile.validatedTarget = &target return cat }