This repository has been archived on 2023-07-05. You can view files and clone it, but cannot push or open issues or pull requests.
clessy/stats/main.go

36 lines
568 B
Go
Raw Normal View History

2016-02-09 15:00:50 +00:00
package main
import (
"flag"
2016-02-10 14:31:53 +00:00
"github.com/boltdb/bolt"
2016-02-09 15:00:50 +00:00
"github.com/hamcha/clessy/tg"
)
2016-02-10 14:31:53 +00:00
func assert(err error) {
if err != nil {
panic(err)
}
}
var db *bolt.DB
2016-02-09 15:00:50 +00:00
func process(broker *tg.Broker, update tg.APIMessage) {
2016-02-10 14:31:53 +00:00
2016-02-09 15:00:50 +00:00
}
func main() {
brokerAddr := flag.String("broker", "localhost:7314", "Broker address:port")
2016-02-10 14:31:53 +00:00
boltdbFile := flag.String("boltdb", "stats.db", "BoltDB database file")
2016-02-09 15:00:50 +00:00
flag.Parse()
2016-02-10 14:31:53 +00:00
db, err := bolt.Open(*boltdbFile, 0600, nil)
assert(err)
defer db.Close()
loadStats()
err = tg.CreateBrokerClient(*brokerAddr, process)
assert(err)
2016-02-09 15:00:50 +00:00
}