File tree 21 files changed +37
-27
lines changed
21 files changed +37
-27
lines changed File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change 1
1
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
2
2
// This file was generated by swaggo/swag at
3
- // 2020-02-21 11:58:17.562006 +0300 +03 m=+3.916537146
3
+ // 2020-02-21 13:07:52.524624 +0300 +03 m=+3.952617600
4
4
5
5
package docs
6
6
@@ -171,10 +171,7 @@ var doc = `{
171
171
"in": "body",
172
172
"required": true,
173
173
"schema": {
174
- "type": "array",
175
- "items": {
176
- "$ref": "#/definitions/ingestion.DecimalMetricValue"
177
- }
174
+ "$ref": "#/definitions/ingestion.DecimalMetricValueList"
178
175
}
179
176
}
180
177
],
@@ -246,6 +243,12 @@ var doc = `{
246
243
}
247
244
}
248
245
},
246
+ "ingestion.DecimalMetricValueList": {
247
+ "type": "array",
248
+ "items": {
249
+ "$ref": "#/definitions/ingestion.DecimalMetricValue"
250
+ }
251
+ },
249
252
"registry.Device": {
250
253
"type": "object",
251
254
"properties": {
Original file line number Diff line number Diff line change 156
156
"in" : " body" ,
157
157
"required" : true ,
158
158
"schema" : {
159
- "type" : " array" ,
160
- "items" : {
161
- "$ref" : " #/definitions/ingestion.DecimalMetricValue"
162
- }
159
+ "$ref" : " #/definitions/ingestion.DecimalMetricValueList"
163
160
}
164
161
}
165
162
],
231
228
}
232
229
}
233
230
},
231
+ "ingestion.DecimalMetricValueList" : {
232
+ "type" : " array" ,
233
+ "items" : {
234
+ "$ref" : " #/definitions/ingestion.DecimalMetricValue"
235
+ }
236
+ },
234
237
"registry.Device" : {
235
238
"type" : " object" ,
236
239
"properties" : {
Original file line number Diff line number Diff line change @@ -25,6 +25,10 @@ definitions:
25
25
value :
26
26
type : number
27
27
type : object
28
+ ingestion.DecimalMetricValueList :
29
+ items :
30
+ $ref : ' #/definitions/ingestion.DecimalMetricValue'
31
+ type : array
28
32
registry.Device :
29
33
properties :
30
34
firmware_version :
@@ -137,9 +141,7 @@ paths:
137
141
name : metrics
138
142
required : true
139
143
schema :
140
- items :
141
- $ref : ' #/definitions/ingestion.DecimalMetricValue'
142
- type : array
144
+ $ref : ' #/definitions/ingestion.DecimalMetricValueList'
143
145
produces :
144
146
- application/json
145
147
responses :
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import (
12
12
// @Tags metric
13
13
// @Accept json
14
14
// @Produce json
15
- // @Param metrics body [] ingestion.DecimalMetricValue true "metrics to insert"
15
+ // @Param metrics body ingestion.DecimalMetricValueList true "metrics to insert"
16
16
// @Success 201 {string} string "inserted the temperature metrics"
17
17
// @Failure 400 {string} string "invalid request parameters"
18
18
// @Failure 401 {string} string "no device token supplied"
Original file line number Diff line number Diff line change @@ -6,11 +6,11 @@ import (
6
6
"github.com/gin-gonic/gin"
7
7
"github.com/swaggo/gin-swagger"
8
8
"github.com/swaggo/gin-swagger/swaggerFiles"
9
+ http_device "iot-demo/adapters/http/device"
10
+ "iot-demo/adapters/http/docs"
11
+ http_health "iot-demo/adapters/http/health"
12
+ http_metrics "iot-demo/adapters/http/metrics"
9
13
add_device "iot-demo/pkg/device/add-device"
10
- http_device "iot-demo/pkg/http/device"
11
- "iot-demo/pkg/http/docs"
12
- http_health "iot-demo/pkg/http/health"
13
- http_metrics "iot-demo/pkg/http/metrics"
14
14
add_metrics "iot-demo/pkg/metrics/add-metrics"
15
15
query_metrics "iot-demo/pkg/metrics/query-metrics"
16
16
"log"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ package main
2
2
3
3
import (
4
4
"context"
5
- "iot-demo/pkg /config"
6
- http_server "iot-demo/pkg /http"
5
+ "iot-demo/adapters /config"
6
+ http_server "iot-demo/adapters /http"
7
7
"log"
8
8
"net/http"
9
9
"os"
Original file line number Diff line number Diff line change @@ -4,15 +4,15 @@ package main
4
4
5
5
import (
6
6
"github.com/google/wire"
7
- "iot-demo/pkg/config"
7
+ "iot-demo/adapters/config"
8
+ http_server "iot-demo/adapters/http"
9
+ "iot-demo/adapters/jwt"
10
+ "iot-demo/adapters/storage/memory"
8
11
add_device "iot-demo/pkg/device/add-device"
9
12
"iot-demo/pkg/device/registry"
10
- http_server "iot-demo/pkg/http"
11
- "iot-demo/pkg/jwt"
12
13
add_metrics "iot-demo/pkg/metrics/add-metrics"
13
14
"iot-demo/pkg/metrics/ingestion"
14
15
query_metrics "iot-demo/pkg/metrics/query-metrics"
15
- "iot-demo/pkg/storage/memory"
16
16
)
17
17
18
18
func NewJWTConfig (cfg config.Static ) jwt.Config {
Original file line number Diff line number Diff line change 1
1
package ingestion
2
2
3
+ type DecimalMetricValueList []* DecimalMetricValue
4
+
3
5
type DecimalMetricValue struct {
4
6
Value float64 `json:"value"`
5
7
// Epoch timestamp in seconds
You can’t perform that action at this time.
0 commit comments