22 lines
325 B
Go
22 lines
325 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"flag"
|
||
|
|
||
|
"../tg"
|
||
|
)
|
||
|
|
||
|
func dispatch(broker *tg.Broker, update tg.APIMessage) {
|
||
|
metafora(broker, update)
|
||
|
}
|
||
|
|
||
|
func main() {
|
||
|
brokerAddr := flag.String("broker", "localhost:7314", "Broker address:port")
|
||
|
flag.Parse()
|
||
|
|
||
|
err := tg.CreateBrokerClient(*brokerAddr, dispatch)
|
||
|
if err != nil {
|
||
|
panic(err)
|
||
|
}
|
||
|
}
|