matches.go 844 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package main
  2. import (
  3. _ "bet24.com/log"
  4. "bet24.com/servers/micros/common"
  5. "bet24.com/servers/micros/matches/config"
  6. "bet24.com/servers/micros/matches/handler"
  7. pb "bet24.com/servers/micros/matches/proto"
  8. "fmt"
  9. "bet24.com/redis"
  10. )
  11. func main() {
  12. config.Run(pb.ServiceName)
  13. //go waitInput()
  14. redis.InitPool(config.Server.ChannelUrl, config.Server.ChannelPassword, config.Server.RedisDB)
  15. common.RunService(pb.ServiceName,
  16. handler.GetInstance(), fmt.Sprintf("localhost:%d", config.Server.ConsulPort))
  17. }
  18. func waitInput() {
  19. for {
  20. var cmd string
  21. var param1 string
  22. var param2 string
  23. fmt.Scanf("%s %s %s", &cmd, &param1, &param2)
  24. switch cmd {
  25. case "":
  26. break
  27. case "exit":
  28. common.DeregisterService(pb.ServiceName)
  29. case "clientpool":
  30. common.DumpClientPools()
  31. default:
  32. handler.Dump(cmd, param1, param2)
  33. }
  34. }
  35. }