stats.go

 1package stats
 2
 3import "log"
 4
 5// Stats provides an interface that can be used to collect metrics about the server.
 6type Stats interface {
 7	Tui(action string)
 8	Push(repo string)
 9	Fetch(repo string)
10}
11
12type stats struct{}
13
14func (s *stats) Tui(action string) {
15	log.Printf("TUI: %s", action)
16}
17
18func (s *stats) Push(repo string) {
19	log.Printf("git push: %s", repo)
20}
21
22func (s *stats) Fetch(repo string) {
23	log.Printf("git fetch: %s", repo)
24}
25
26func NewStats() Stats {
27	return &stats{}
28}