mirror of
https://github.com/johnkerl/miller.git
synced 2026-07-30 03:01:39 +00:00
20 lines
565 B
Go
20 lines
565 B
Go
package input
|
|
|
|
import (
|
|
"miller/src/types"
|
|
)
|
|
|
|
// Since Go is concurrent, the context struct (AWK-like variables such as
|
|
// FILENAME, NF, NF, FNR, etc.) needs to be duplicated and passed through the
|
|
// channels along with each record. Hence the initial context, which readers
|
|
// update on each new file/record, and the channel of types.RecordAndContext
|
|
// rather than channel of types.Mlrmap.
|
|
|
|
type IRecordReader interface {
|
|
Read(
|
|
filenames []string,
|
|
initialContext types.Context,
|
|
inputChannel chan<- *types.RecordAndContext,
|
|
errorChannel chan error,
|
|
)
|
|
}
|