Files
learngo/interfaces/log-parser/oop/main.go

41 lines
736 B
Go
Raw Normal View History

2019-08-17 15:55:25 +03:00
// 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"
2019-08-19 20:00:27 +03:00
// "fmt"
2019-08-17 15:55:25 +03:00
"os"
)
func main() {
2019-08-26 14:37:58 +03:00
an := newAnalysis()
// an.filterBy(notUsing(domainExtFilter("io", "com")))
// an.filterBy(domainFilter("org"))
// an.groupBy(domainGrouper)
2019-08-17 15:55:25 +03:00
2019-08-26 14:37:58 +03:00
src := newTextLog(os.Stdin)
dst := newTextReport()
2019-08-17 15:55:25 +03:00
2019-08-26 14:37:58 +03:00
// s := &chartReport{
// title: "visits per domain",
// width: 1920,
// height: 800,
// }
pipe := newPipeline(src, dst, an)
2019-08-17 15:55:25 +03:00
2019-08-26 14:37:58 +03:00
if err := pipe.run(); err != nil {
2019-08-17 15:55:25 +03:00
log.Fatalln(err)
}
2019-08-19 20:00:27 +03:00
// if err := reportFromFile(os.Args[1]); err != nil {
// log.Fatalln(err)
// }
2019-08-17 15:55:25 +03:00
}