Просмотр исходного кода

chore: update node-red test with MQTT messages

chore/proposed-structure
Blaz Smehov 4 недель назад
Родитель
Сommit
dc0bb7c777
3 измененных файлов: 174 добавлений и 38 удалений
  1. +2
    -0
      cmd/decoder/main.go
  2. +0
    -2
      cmd/server/main.go
  3. +172
    -36
      test/node-red-integration-tests/apitest.json

+ 2
- 0
cmd/decoder/main.go Просмотреть файл

@@ -146,6 +146,8 @@ func processIncoming(incoming model.Incoming_json, ctx *model.AppContext) {
}
}()

fmt.Println("message came")

incoming = mqttclient.IncomingBeaconFilter(incoming)
id := mqttclient.GetBeaconID(incoming)
now := time.Now().Unix()


+ 0
- 2
cmd/server/main.go Просмотреть файл

@@ -50,8 +50,6 @@ func HttpServer(addr string) {
http.ListenAndServe(addr, handlers.CORS(originsOk, headersOk, methodsOk)(r))
}

// This looks wrong, should handle error somehow

func sendKafkaMessage(writer *kafka.Writer, value *model.ApiUpdate) bool {
valueStr, err := json.Marshal(&value)
if err != nil {


+ 172
- 36
test/node-red-integration-tests/apitest.json
Разница между файлами не показана из-за своего большого размера
Просмотреть файл


Загрузка…
Отмена
Сохранить