Documentation ¶
Overview ¶
Package output contains logic for formatting output records as strings to standard output.
Index ¶
- func ChannelWriter(writerChannel <-chan *list.List, recordWriter IRecordWriter, ...)
- type FileOutputHandler
- func NewFileAppendOutputHandler(filename string, recordWriterOptions *cli.TWriterOptions) (*FileOutputHandler, error)
- func NewFileOutputHandler(filename string, recordWriterOptions *cli.TWriterOptions, doAppend bool) (*FileOutputHandler, error)
- func NewFileWriteOutputHandler(filename string, recordWriterOptions *cli.TWriterOptions) (*FileOutputHandler, error)
- func NewPipeWriteOutputHandler(commandString string, recordWriterOptions *cli.TWriterOptions) (*FileOutputHandler, error)
- type IRecordWriter
- type MultiOutputHandlerManager
- func NewFileAppendHandlerManager(recordWriterOptions *cli.TWriterOptions) *MultiOutputHandlerManager
- func NewFileOutputHandlerManager(recordWriterOptions *cli.TWriterOptions, doAppend bool) *MultiOutputHandlerManager
- func NewFileWritetHandlerManager(recordWriterOptions *cli.TWriterOptions) *MultiOutputHandlerManager
- func NewPipeWriteHandlerManager(recordWriterOptions *cli.TWriterOptions) *MultiOutputHandlerManager
- func NewStderrWriteHandlerManager(recordWriterOptions *cli.TWriterOptions) *MultiOutputHandlerManager
- func NewStdoutWriteHandlerManager(recordWriterOptions *cli.TWriterOptions) *MultiOutputHandlerManager
- type OutputHandler
- type OutputHandlerManager
- type RecordWriterCSV
- type RecordWriterCSVLite
- type RecordWriterDKVP
- type RecordWriterJSON
- type RecordWriterMarkdown
- type RecordWriterNIDX
- type RecordWriterPPRINT
- type RecordWriterTSV
- type RecordWriterXTAB
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChannelWriter ¶
func ChannelWriter( writerChannel <-chan *list.List, recordWriter IRecordWriter, writerOptions *cli.TWriterOptions, doneChannel chan<- bool, dataProcessingErrorChannel chan<- bool, bufferedOutputStream *bufio.Writer, outputIsStdout bool, )
Types ¶
type FileOutputHandler ¶
type FileOutputHandler struct {
// contains filtered or unexported fields
}
================================================================
func NewFileAppendOutputHandler ¶
func NewFileAppendOutputHandler( filename string, recordWriterOptions *cli.TWriterOptions, ) (*FileOutputHandler, error)
func NewFileOutputHandler ¶
func NewFileOutputHandler( filename string, recordWriterOptions *cli.TWriterOptions, doAppend bool, ) (*FileOutputHandler, error)
----------------------------------------------------------------
func NewFileWriteOutputHandler ¶
func NewFileWriteOutputHandler( filename string, recordWriterOptions *cli.TWriterOptions, ) (*FileOutputHandler, error)
func NewPipeWriteOutputHandler ¶
func NewPipeWriteOutputHandler( commandString string, recordWriterOptions *cli.TWriterOptions, ) (*FileOutputHandler, error)
func (*FileOutputHandler) Close ¶
func (handler *FileOutputHandler) Close() (retval error)
----------------------------------------------------------------
func (*FileOutputHandler) WriteRecordAndContext ¶
func (handler *FileOutputHandler) WriteRecordAndContext( outrecAndContext *types.RecordAndContext, ) error
----------------------------------------------------------------
func (*FileOutputHandler) WriteString ¶
func (handler *FileOutputHandler) WriteString(outputString string) error
----------------------------------------------------------------
type IRecordWriter ¶
type IRecordWriter interface { Write( outrec *mlrval.Mlrmap, context *types.Context, bufferedOutputStream *bufio.Writer, outputIsStdout bool, ) error }
IRecordWriter is the abstract interface for all record-writers. They are specific to output file format, e.g. CSV, PPRINT, JSON, etc.
Convention: nil outrec signifies end of record stream.
The ChannelWriter will call bufferedOutputStream.Flush() after every record if the --fflush flag (writerOptions.FlushOnEveryRecord) is present, so each writer does not have to -- unless the writer retains records e.g. for PPRINT format.
func Create ¶
func Create(writerOptions *cli.TWriterOptions) (IRecordWriter, error)
type MultiOutputHandlerManager ¶
type MultiOutputHandlerManager struct {
// contains filtered or unexported fields
}
================================================================
func NewFileAppendHandlerManager ¶
func NewFileAppendHandlerManager( recordWriterOptions *cli.TWriterOptions, ) *MultiOutputHandlerManager
func NewFileOutputHandlerManager ¶
func NewFileOutputHandlerManager( recordWriterOptions *cli.TWriterOptions, doAppend bool, ) *MultiOutputHandlerManager
----------------------------------------------------------------
func NewFileWritetHandlerManager ¶
func NewFileWritetHandlerManager( recordWriterOptions *cli.TWriterOptions, ) *MultiOutputHandlerManager
func NewPipeWriteHandlerManager ¶
func NewPipeWriteHandlerManager( recordWriterOptions *cli.TWriterOptions, ) *MultiOutputHandlerManager
func NewStderrWriteHandlerManager ¶
func NewStderrWriteHandlerManager( recordWriterOptions *cli.TWriterOptions, ) *MultiOutputHandlerManager
func NewStdoutWriteHandlerManager ¶
func NewStdoutWriteHandlerManager( recordWriterOptions *cli.TWriterOptions, ) *MultiOutputHandlerManager
func (*MultiOutputHandlerManager) Close ¶
func (manager *MultiOutputHandlerManager) Close() []error
func (*MultiOutputHandlerManager) WriteRecordAndContext ¶
func (manager *MultiOutputHandlerManager) WriteRecordAndContext( outrecAndContext *types.RecordAndContext, filename string, ) error
func (*MultiOutputHandlerManager) WriteString ¶
func (manager *MultiOutputHandlerManager) WriteString( outputString string, filename string, ) error
----------------------------------------------------------------
type OutputHandler ¶
type OutputHandlerManager ¶
type OutputHandlerManager interface { // For print-variants and dump-variants WriteString(outputString string, filename string) error // For emit-variants and tee WriteRecordAndContext(outrecAndContext *types.RecordAndContext, filename string) error Close() []error }
================================================================
type RecordWriterCSV ¶
type RecordWriterCSV struct {
// contains filtered or unexported fields
}
func NewRecordWriterCSV ¶
func NewRecordWriterCSV(writerOptions *cli.TWriterOptions) (*RecordWriterCSV, error)
func (*RecordWriterCSV) WriteCSVRecordMaybeColorized ¶
type RecordWriterCSVLite ¶
type RecordWriterCSVLite struct {
// contains filtered or unexported fields
}
func NewRecordWriterCSVLite ¶
func NewRecordWriterCSVLite(writerOptions *cli.TWriterOptions) (*RecordWriterCSVLite, error)
type RecordWriterDKVP ¶
type RecordWriterDKVP struct {
// contains filtered or unexported fields
}
func NewRecordWriterDKVP ¶
func NewRecordWriterDKVP(writerOptions *cli.TWriterOptions) (*RecordWriterDKVP, error)
type RecordWriterJSON ¶
type RecordWriterJSON struct {
// contains filtered or unexported fields
}
----------------------------------------------------------------
func NewRecordWriterJSON ¶
func NewRecordWriterJSON(writerOptions *cli.TWriterOptions) (*RecordWriterJSON, error)
----------------------------------------------------------------
type RecordWriterMarkdown ¶
type RecordWriterMarkdown struct {
// contains filtered or unexported fields
}
func NewRecordWriterMarkdown ¶
func NewRecordWriterMarkdown(writerOptions *cli.TWriterOptions) (*RecordWriterMarkdown, error)
type RecordWriterNIDX ¶
type RecordWriterNIDX struct {
// contains filtered or unexported fields
}
func NewRecordWriterNIDX ¶
func NewRecordWriterNIDX(writerOptions *cli.TWriterOptions) (*RecordWriterNIDX, error)
type RecordWriterPPRINT ¶
type RecordWriterPPRINT struct {
// contains filtered or unexported fields
}
func NewRecordWriterPPRINT ¶
func NewRecordWriterPPRINT(writerOptions *cli.TWriterOptions) (*RecordWriterPPRINT, error)
type RecordWriterTSV ¶
type RecordWriterTSV struct {
// contains filtered or unexported fields
}
func NewRecordWriterTSV ¶
func NewRecordWriterTSV(writerOptions *cli.TWriterOptions) (*RecordWriterTSV, error)
type RecordWriterXTAB ¶
type RecordWriterXTAB struct {
// contains filtered or unexported fields
}
func NewRecordWriterXTAB ¶
func NewRecordWriterXTAB(writerOptions *cli.TWriterOptions) (*RecordWriterXTAB, error)
Source Files ¶
- channel_writer.go
- doc.go
- file_output_handlers.go
- record_writer.go
- record_writer_csv.go
- record_writer_csv_colorizer.go
- record_writer_csvlite.go
- record_writer_dkvp.go
- record_writer_factory.go
- record_writer_json.go
- record_writer_markdown.go
- record_writer_nidx.go
- record_writer_pprint.go
- record_writer_tsv.go
- record_writer_xtab.go