Documentation ¶
Index ¶
- func FindInTar(tarfile, search string) map[string]string
- func JsonEscape(i string) string
- func ListTar(filename string) []string
- func MustProcessTemplateFile(template string, bundle interface{}) string
- func MustTemplate(str string, data interface{}) string
- func OnlyWriteCSV(w csv.Writer, columns []string, rows []map[string]interface{}) error
- func ProcessTemplateFile(template string, bundle interface{}) ([]byte, error)
- func ReadCSV(filename string) ([]map[string]string, []string, error)
- func ReadTar(tarfile, filename string) interface{}
- func RegisterFS(filesystem afero.Fs)
- func SplitKeys(v interface{}) ([]string, []map[string]interface{}, error)
- func Template(str string, data interface{}) (string, error)
- func TemplateDelim(str string, data interface{}, begin, end string) (string, error)
- func WriteCSV(file io.ReadWriter, columns []string, rows []map[string]interface{}) ([]byte, error)
- func WriteTar(datafile, filename string, buf []byte)
- type Parser
- type ParserFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindInTar ¶
FindInTar looks for search string in tarball, returns list of filenames and matches
func MustProcessTemplateFile ¶
MustProcessTemplateFile processes golang template file
func MustTemplate ¶
MustTemplate parses string as Go template, using data as scope
func OnlyWriteCSV ¶
OnlyWriteCSV writes headers and rows into a given file handle
func ProcessTemplateFile ¶
ProcessTemplateFile processes golang template file
func ReadTar ¶
func ReadTar(tarfile, filename string) interface{}
ReadTar reads filename from given tarball and returns content
func RegisterFS ¶
RegisterFS (afero) virtual filesystem for ProcessTemplateFile
func TemplateDelim ¶
TemplateDelim parses string with custom delimiters as Go template, using data as scope
Types ¶
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser is the main type
func (*Parser) ParseStruct ¶
ParseStruct parses byte slice into map or slice
func (*Parser) ReadStruct ¶
ReadStruct reads from given file, parsing into structure
func (*Parser) RegisterParser ¶
func (l *Parser) RegisterParser(format string, parser ParserFunc)
RegisterParser registers or overrides a format parser func. Indices are lower case.
type ParserFunc ¶
ParserFunc is to parse a []byte into an interface{}