mirror of
https://github.com/johnkerl/miller.git
synced 2026-01-23 02:14:13 +00:00
* Update package version * Update makefile targets * Update readme packages * Remaining old packages via rg/sd
26 lines
741 B
Go
26 lines
741 B
Go
package output
|
|
|
|
import (
|
|
"bufio"
|
|
|
|
"github.com/johnkerl/miller/v6/pkg/mlrval"
|
|
"github.com/johnkerl/miller/v6/pkg/types"
|
|
)
|
|
|
|
// 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.
|
|
type IRecordWriter interface {
|
|
Write(
|
|
outrec *mlrval.Mlrmap,
|
|
context *types.Context,
|
|
bufferedOutputStream *bufio.Writer,
|
|
outputIsStdout bool,
|
|
) error
|
|
}
|