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
2016-02-10 14:31:53 +00:00

35 lines
568 B
Go

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