mirror of
https://github.com/johnkerl/miller.git
synced 2026-07-29 02:30:12 +00:00
neaten
This commit is contained in:
parent
a7359852c0
commit
481a894fd4
4 changed files with 38 additions and 30 deletions
24
go/src/mapping/mapper_nothing.go
Normal file
24
go/src/mapping/mapper_nothing.go
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
package mapping
|
||||
|
||||
import (
|
||||
"containers"
|
||||
)
|
||||
|
||||
type MapperNothing struct {
|
||||
// stateless
|
||||
}
|
||||
|
||||
func NewMapperNothing() *MapperNothing {
|
||||
return &MapperNothing {
|
||||
}
|
||||
}
|
||||
|
||||
func (this *MapperNothing) Name() string {
|
||||
return "nothing"
|
||||
}
|
||||
|
||||
func (this *MapperNothing) Map(inrec *containers.Lrec, outrecs chan<- *containers.Lrec) {
|
||||
if inrec == nil { // end of stream
|
||||
outrecs <- inrec
|
||||
}
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@ package mapping
|
|||
func Create(mapperName string) RecordMapper {
|
||||
switch mapperName {
|
||||
case "cat": return NewMapperCat()
|
||||
case "nothing": return NewMapperNothing()
|
||||
case "tac": return NewMapperTac()
|
||||
default: return nil
|
||||
}
|
||||
|
|
|
|||
43
go/todo.txt
43
go/todo.txt
|
|
@ -1,32 +1,15 @@
|
|||
* input.RecordReader interface
|
||||
* impls:
|
||||
o dkvp
|
||||
o xtab
|
||||
o csv
|
||||
o streaming json
|
||||
o etc
|
||||
* factory
|
||||
* remove argf
|
||||
* needs fresh start on each new filename
|
||||
* lots of trivial things are just a matter of keystroking
|
||||
* defer them while focusing on what's hard (and maybe most worthwhile about the Go port)
|
||||
|
||||
* mapper interface
|
||||
* impls:
|
||||
o cat
|
||||
o cut
|
||||
o head
|
||||
o tail
|
||||
o count
|
||||
o ... lots more over time (if ever)
|
||||
o defer DSL for a good long while
|
||||
* factory
|
||||
* defer then-chaining for the merest of moments
|
||||
o needs []mapchan in the streamer
|
||||
harder / more worthy:
|
||||
* streaming JSON reader
|
||||
* streaming RFC-compliant CSV reader
|
||||
* sort
|
||||
* stats1
|
||||
* DSL
|
||||
* calendar/DST/TZ
|
||||
|
||||
* output.RecordWriter interface
|
||||
* impls:
|
||||
o dkvp
|
||||
o xtab
|
||||
o csv
|
||||
o json
|
||||
o etc
|
||||
* factory
|
||||
easier:
|
||||
* most of the verbs
|
||||
* most of the file formats
|
||||
* then-chaining
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue