Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 

56 rindas
1.3 KiB

  1. package config
  2. import (
  3. "egg-im/pkg/logger"
  4. "go.uber.org/zap"
  5. "os"
  6. )
  7. const (
  8. //RPCListenAddr = ":8000"
  9. //TCPListenAddr = ":8080"
  10. //WSListenAddr = ":8001"
  11. RPCListenAddr = ":8000"
  12. TCPListenAddr = ":8001"
  13. WSListenAddr = ":8002"
  14. )
  15. var (
  16. NameSpace string = "egg-im"
  17. MySQL string = "root:Fnuo123com@@tcp(119.23.182.117:3306)/egg-im?charset=utf8&parseTime=true&loc=Local"
  18. RedisIP string = "120.24.28.6:32572"
  19. RedisPassword string = ""
  20. LocalAddr string
  21. PushRoomSubscribeNum int
  22. PushAllSubscribeNum int
  23. )
  24. func Init() {
  25. //k8sClient, err := k8sutil.GetK8sClient()
  26. //if err != nil {
  27. // panic(err)
  28. //}
  29. //configmap, err := k8sClient.CoreV1().ConfigMaps(NameSpace).Get(context.TODO(), "config", metav1.GetOptions{})
  30. //if err != nil {
  31. // panic(err)
  32. //}
  33. //
  34. //MySQL = configmap.Data["mysql"]
  35. //RedisIP = configmap.Data["redisIP"]
  36. //RedisPassword = configmap.Data["redisPassword"]
  37. //PushRoomSubscribeNum, _ = strconv.Atoi(configmap.Data["pushRoomSubscribeNum"])
  38. //if PushRoomSubscribeNum == 0 {
  39. // panic("PushRoomSubscribeNum == 0")
  40. //}
  41. //PushAllSubscribeNum, _ = strconv.Atoi(configmap.Data["pushAllSubscribeNum"])
  42. //if PushRoomSubscribeNum == 0 {
  43. // panic("PushAllSubscribeNum == 0")
  44. //}
  45. LocalAddr = os.Getenv("POD_IP") + RPCListenAddr
  46. logger.Level = zap.DebugLevel
  47. logger.Target = logger.Console
  48. }