# README
File Helper
See (limited) tests for example usage. This package is used by some other projects, you might find it useful as well, but this package is a borderline anti-pattern.
Main responsibilities:
- read and write csv
- unified file read for csv, xml or json with extendible parsing
- template parsing with handy functions - see tests
# Functions
FindInTar looks for search string in tarball, returns list of filenames and matches.
JsonEscape escapes a string for JSON.
ListTar will return file list from given tar file.
MustProcessTemplateFile processes golang template file.
MustTemplate parses string as Go template, using data as scope.
NewParser defines a new parser.
OnlyWriteCSV writes headers and rows into a given file handle.
ProcessTemplateFile processes golang template file.
ReadCSV reads csv into []map[string]string + []string for headers.
ReadTar reads filename from given tarball and returns content.
RegisterFS (afero) virtual filesystem for ProcessTemplateFile.
SplitKeys creates a map for CSV header.
Template parses string as Go template, using data as scope.
TemplateDelim parses string with custom delimiters as Go template, using data as scope.
WriteCSV writes headers and rows into a given file handle and reads it back as []byte.
WriteTar will append to datafile with filename using buf data.
# Type aliases
ParserFunc is to parse a []byte into an interface{}.