| | |
| | | ) |
| | | |
| | | type Config struct { |
| | | NsqServer string `json:"nsq_server"` // nsq TCP服务端地址 |
| | | PubPLCDataTopic string `json:"plc_data_topic"` // 发布plc数据的topic |
| | | PLCSetTopic string `json:"plc_set_topic"` // 接收plc配置数据的topic |
| | | SubDeviceTopic string `json:"sub_device_topic"` // 接收设备变更通知的topic |
| | | ApsDeviceWebApi string `json:"aps_device_webapi"` // 获取设备列表的接口, aps 提供, http接口 |
| | | ApsPLCDataWebApi string `json:"aps_plc_data_webapi"` // 上传给aps plc数据的接口地址. aps 提供, http接口 |
| | | NsqServer string `json:"nsq_server"` // nsq TCP服务端地址 |
| | | PubPLCDataTopic string `json:"pub_plc_data_topic"` // 发布plc数据的topic |
| | | WritePLCDataTopic string `json:"write_plc_data_topic"` // 接收plc配置数据的topic |
| | | SubDeviceTopic string `json:"sub_device_topic"` // 接收设备变更通知的topic |
| | | DeviceListWebApi string `json:"device_List_webapi"` // 获取设备列表的接口, aps 提供, http接口 |
| | | PostPLCDataWebApi string `json:"post_plc_data_webapi"` // 上传给aps plc数据的接口地址. aps 提供, http接口 |
| | | } |
| | | |
| | | const configPath = "config.json" |
| | |
| | | func DefaultConfig() { |
| | | Options.NsqServer = "fai365.com:4150" |
| | | Options.PubPLCDataTopic = "aps.factory.plc.livedata" |
| | | Options.PLCSetTopic = "" |
| | | Options.ApsDeviceWebApi = "" |
| | | Options.ApsPLCDataWebApi = "" |
| | | Options.WritePLCDataTopic = "aps.factory.plc.write" |
| | | Options.SubDeviceTopic = "" |
| | | Options.DeviceListWebApi = "aps.factory.plc.device" |
| | | Options.PostPLCDataWebApi = "" |
| | | } |
| | | |
| | | func Load() { |