mirror of
https://github.com/foomo/contentserver.git
synced 2025-10-16 12:25:44 +00:00
29 lines
362 B
Go
29 lines
362 B
Go
package server
|
|
|
|
import (
|
|
"github.com/foomo/contentserver/server/repo"
|
|
)
|
|
|
|
// our data
|
|
|
|
type Stats struct {
|
|
requests int64
|
|
}
|
|
|
|
func NewStats() *Stats {
|
|
stats := new(Stats)
|
|
stats.requests = 0
|
|
return stats
|
|
}
|
|
|
|
var stats *Stats = NewStats()
|
|
var contentRepo *repo.Repo
|
|
|
|
func countRequest() {
|
|
stats.requests++
|
|
}
|
|
|
|
func numRequests() int64 {
|
|
return stats.requests
|
|
}
|