refactor: logparser v5 to pkgs

This commit is contained in:
Inanc Gumus
2019-08-28 23:46:42 +03:00
parent 4629b59ef2
commit 81b4246973
26 changed files with 601 additions and 458 deletions

35
logparser/v5/main.go Normal file
View File

@ -0,0 +1,35 @@
// For more tutorials: https://blog.learngoprogramming.com
//
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
package main
import (
"log"
"os"
"github.com/inancgumus/learngo/logparser/v5/pipe"
)
func main() {
// p := pipe.Default(
// os.Stdin, os.Stdout,
// pipe.FilterBy(pipe.DomainExtFilter("com", "io")),
// pipe.GroupBy(pipe.DomainGrouper),
// )
p := pipe.New(
pipe.NewTextLog(os.Stdin),
pipe.NewTextReport(os.Stdout),
// pipe.NewJSONReport(os.Stdout),
pipe.FilterBy(pipe.DomainExtFilter("com", "io")),
pipe.GroupBy(pipe.DomainGrouper),
)
if err := p.Run(); err != nil {
log.Fatalln(err)
}
}