tcp server 用于给andriod 客户端定时发送消息
liuxiaolong
2019-12-11 534dc72c2248a545b1b41d11f144448b0fddb6a7
extend/config/config.go
@@ -11,8 +11,8 @@
   ServerId string `mapstructure: "serverId"`
   ServerIp string `mapstructure: "serverIp"`
   VideoPort string   `mapstructure: "videoPort"`
   NginxIp string  `mapstructure: "ngxIp"`
   NginxPort string   `mapstructure: "ngxPort"`
   NgxIp string  `mapstructure: "ngxIp"`
   NgxPort string   `mapstructure: "ngxPort"`
}
var serverList = &server{}
@@ -26,12 +26,12 @@
   viper.AddConfigPath("./config/")
   err = viper.ReadInConfig()
   if err != nil {
      log.Fatal("error on parsing configuration file")
      log.Fatal("error on parsing configuration file",err)
   }
   viper.UnmarshalKey("server", serverList)
   for _,s :=range *serverList {
      si := s
      ServerMap[si.ServerId] = "http://"+si.ServerIp+":"+si.VideoPort+"/getRecordVideoPath"
      NgxMap[si.ServerId] = "http://"+si.NginxIp+":"+si.NginxPort+"/videosource"
      NgxMap[si.ServerId] = "http://"+si.NgxIp+":"+si.NgxPort+"/videosource"
   }
}