refactor: oop log parser

This commit is contained in:
Inanc Gumus
2019-08-26 14:37:58 +03:00
parent 912d789933
commit 5215300d31
8 changed files with 136 additions and 126 deletions

View File

@@ -14,20 +14,23 @@ import (
)
func main() {
a := newAnalysis()
// a.filterBy(notUsing(domainExtFilter("io", "com")))
// a.groupBy(domainGrouper)
an := newAnalysis()
// an.filterBy(notUsing(domainExtFilter("io", "com")))
// an.filterBy(domainFilter("org"))
// an.groupBy(domainGrouper)
p := newTextParser(os.Stdin)
s := newTextSummary()
src := newTextLog(os.Stdin)
dst := newTextReport()
// s := &chartSummary{
// title: "visits per domain",
// width: 1920,
// height: 800,
// }
// s := &chartReport{
// title: "visits per domain",
// width: 1920,
// height: 800,
// }
if err := report(p, a, s); err != nil {
pipe := newPipeline(src, dst, an)
if err := pipe.run(); err != nil {
log.Fatalln(err)
}