예제 #1
0
// NewCSVTransformer returns a new CSVTransformer wrapping the given io.Writer object
func NewCSVTransformer() *CSVTransformer {
	return &CSVTransformer{
		Parameters: util.CSVParameters{
			Writer:        util.NewCSVWriter(),
			WriteHeader:   true,
			HeaderWritten: false,
			SendUpstream:  true,
		},
	}
}
예제 #2
0
// NewCSVWriter returns a new CSVWriter wrapping the given io.Writer object
func NewCSVWriter(w io.Writer) *CSVWriter {
	writer := util.NewCSVWriter()
	writer.SetWriter(w)

	return &CSVWriter{
		Parameters: util.CSVParameters{
			Writer:        writer,
			WriteHeader:   true,
			HeaderWritten: false,
			SendUpstream:  false,
		},
	}
}