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

38 lines
674 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-19 20:00:27 +03:00
a := newAnalysis()
// a.filterBy(notUsing(domainExtFilter("io", "com")))
// a.groupBy(domainGrouper)
2019-08-17 15:55:25 +03:00
2019-08-19 20:00:27 +03:00
p := newTextParser(os.Stdin)
s := newTextSummary()
2019-08-17 15:55:25 +03:00
2019-08-19 20:00:27 +03:00
// s := &chartSummary{
// title: "visits per domain",
// width: 1920,
// height: 800,
// }
2019-08-17 15:55:25 +03:00
2019-08-19 20:00:27 +03:00
if err := report(p, a, s); 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
}