From dec513023b0d4020a7d78e73e715857e5eb6244c Mon Sep 17 00:00:00 2001 From: Kirill Isakov Date: Sun, 14 Feb 2021 13:25:16 +0600 Subject: [PATCH] Add support for ceb pollution data source --- gateway/airkaz/airkaz.go | 42 +++----------- gateway/ceb/ceb.go | 101 +++++++++++++++++++++++++++++++++ gateway/main.go | 2 + gateway/{airkaz => net}/net.go | 4 +- gateway/tm/tm.go | 32 +++++++++++ 5 files changed, 145 insertions(+), 36 deletions(-) create mode 100644 gateway/ceb/ceb.go rename gateway/{airkaz => net}/net.go (90%) create mode 100644 gateway/tm/tm.go diff --git a/gateway/airkaz/airkaz.go b/gateway/airkaz/airkaz.go index d79eb63..b6afcf1 100644 --- a/gateway/airkaz/airkaz.go +++ b/gateway/airkaz/airkaz.go @@ -3,43 +3,19 @@ package airkaz import ( "encoding/json" "github.com/hg/airmon/influx" + "github.com/hg/airmon/net" + "github.com/hg/airmon/tm" influxdb2 "github.com/influxdata/influxdb-client-go/v2" "github.com/pkg/errors" "io/ioutil" "log" "net/http" "regexp" - "strings" "time" ) var dataRe = regexp.MustCompile(`(?si).*sensors_data\s*=\s*(\[.+])