diff --git a/.gitignore b/.gitignore index 2719cb2..651d177 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ config.json clessy-broker -clessy-mods \ No newline at end of file +clessy-mods +clessy-stats \ No newline at end of file diff --git a/Makefile b/Makefile index 2d7232f..03071a5 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,16 @@ -all: clessy-broker +all: clessy-broker clessy-mods clessy-stats -clessy-broker: - go build -o clessy-broker ./broker - go build -o clessy-mods ./mods +install-tg: + go install github.com/hamcha/clessy/tg + +clessy-broker: install-tg + go build -o clessy-broker github.com/hamcha/clessy/broker + +clessy-mods: install-tg + go build -o clessy-mods github.com/hamcha/clessy/mods + +clessy-stats: install-tg + go build -o clessy-stats github.com/hamcha/clessy/stats clean: - rm -f clessy-broker clessy-mods + rm -f clessy-broker clessy-mods clessy-stats \ No newline at end of file diff --git a/stats/main.go b/stats/main.go new file mode 100644 index 0000000..0e70f11 --- /dev/null +++ b/stats/main.go @@ -0,0 +1,20 @@ +package main + +import ( + "flag" + + "github.com/hamcha/clessy/tg" +) + +func process(broker *tg.Broker, update tg.APIMessage) { +} + +func main() { + brokerAddr := flag.String("broker", "localhost:7314", "Broker address:port") + flag.Parse() + + err := tg.CreateBrokerClient(*brokerAddr, process) + if err != nil { + panic(err) + } +}