Documentation
¶
Index ¶
- func ConstructPath(preffix, directory, fileName string) (s string)
- func FilesEqual(a, b File) bool
- func ReadDirectory(dirPath string) (entries []fs.DirEntry)
- func RemoveAllWithinDirectory(path string)
- func ZipFolder(folderPath, outputName string)
- func ZipFolderO(path, output string)
- type CSVFile
- type Crawler
- type File
- func (f *File) Append(s string)
- func (f *File) AppendLine(s string)
- func (f *File) ClearFile()
- func (f *File) Contents() []byte
- func (f *File) IsEmpty() bool
- func (f *File) Name() string
- func (f File) Read(p []byte) (n int, err error)
- func (f *File) String() string
- func (f *File) Write(p []byte) (n int, err error)
- type TextFile
- func (f *TextFile) Append(s string, newline bool)
- func (t *TextFile) AppendEmptyLine()
- func (t *TextFile) AppendLastLine(s string)
- func (t *TextFile) AppendLines(arr []string, newline bool)
- func (f *TextFile) AppendNewLine(s string)
- func (f *TextFile) ReadFile() []string
- func (f *TextFile) ReadLine(lineNum int) (output string, err error)
- func (t *TextFile) WriteLine(s string, i int, newline bool)
- type ZipCrawler
- type ZipFile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConstructPath ¶
func FilesEqual ¶
func RemoveAllWithinDirectory ¶
func RemoveAllWithinDirectory(path string)
func ZipFolderO ¶
func ZipFolderO(path, output string)
Types ¶
type CSVFile ¶
type CSVFile struct { TextFile // contains filtered or unexported fields }
~~~~~~~~~~~~~~~~~~~~ CSVFile
func (*CSVFile) GetContents ¶
func (*CSVFile) GetIndexOfColumn ¶
func (*CSVFile) NumHeaders ¶
type File ¶
type File struct {
// contains filtered or unexported fields
}
func (*File) AppendLine ¶
func (File) Read ¶
copied from io.go Reader is the interface that wraps the basic Read method.
Read reads up to len(p) bytes into p. It returns the number of bytes read (0 <= n <= len(p)) and any error encountered. Even if Read returns n < len(p), it may use all of p as scratch space during the call. If some data is available but not len(p) bytes, Read conventionally returns what is available instead of waiting for more.
When Read encounters an error or end-of-file condition after successfully reading n > 0 bytes, it returns the number of bytes read. It may return the (non-nil) error from the same call or return the error (and n == 0) from a subsequent call. An instance of this general case is that a Reader returning a non-zero number of bytes at the end of the input stream may return either err == EOF or err == nil. The next Read should return 0, EOF.
Callers should always process the n > 0 bytes returned before considering the error err. Doing so correctly handles I/O errors that happen after reading some bytes and also both of the allowed EOF behaviors.
If len(p) == 0, Read should always return n == 0. It may return a non-nil error if some error condition is known, such as EOF.
Implementations of Read are discouraged from returning a zero byte count with a nil error, except when len(p) == 0. Callers should treat a return of 0 and nil as indicating that nothing happened; in particular it does not indicate EOF.
Implementations must not retain p.
func (*File) Write ¶
copied from io.go Writer is the interface that wraps the basic Write method.
Write writes len(p) bytes from p to the underlying data stream. It returns the number of bytes written from p (0 <= n <= len(p)) and any error encountered that caused the write to stop early. Write must return a non-nil error if it returns n < len(p). Write must not modify the slice data, even temporarily.
Implementations must not retain p.
type TextFile ¶
type TextFile struct { File // contains filtered or unexported fields }
func NewTextFile ¶
func NewTextFileWithSuffix ¶
func (*TextFile) AppendEmptyLine ¶
func (t *TextFile) AppendEmptyLine()
func (*TextFile) AppendLastLine ¶
func (*TextFile) AppendLines ¶
func (*TextFile) AppendNewLine ¶
type ZipCrawler ¶
type ZipCrawler struct { ZipFile // contains filtered or unexported fields }
func (*ZipCrawler) Crawl ¶
func (c *ZipCrawler) Crawl(filename string)
func (*ZipCrawler) HandleFile ¶
func (c *ZipCrawler) HandleFile(filename os.DirEntry)
func (*ZipCrawler) HandleFolder ¶
func (c *ZipCrawler) HandleFolder(folderName os.DirEntry)
type ZipFile ¶
type ZipFile struct {
// contains filtered or unexported fields
}
~~~~~~~~~~~~~~~~~~~~ ZipFile
func NewZipFile ¶
func (*ZipFile) WriteAndClose ¶
func (z *ZipFile) WriteAndClose()