forked from iot-for-all/starling
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.go
53 lines (49 loc) · 1.41 KB
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package main
import (
"github.com/iot-for-all/starling/pkg/serving"
"github.com/iot-for-all/starling/pkg/simulating"
"github.com/iot-for-all/starling/pkg/storing"
)
type (
Config struct {
LogLevel string `yaml:"logLevel" json:"logLevel"` // logging level for the application
LogsDir string `yaml:"logsDir" json:"logsDir"` // directory into which logs are written
}
config struct {
Logger Config `yaml:"Logger" json:"Logger"`
Data storing.Config `yaml:"Data" json:"Data"`
HTTP serving.Config `yaml:"HTTP" json:"HTTP"`
Simulation simulating.Config `yaml:"Simulation" json:"Simulation"`
}
)
func newConfig() *config {
return &config{
Logger: Config{
LogLevel: "Debug",
LogsDir: "./logs",
},
Data: storing.Config{
DataDirectory: "./",
},
HTTP: serving.Config{
AdminPort: 6001,
MetricsPort: 6002,
},
Simulation: simulating.Config{
ConnectionTimeout: 10000,
TelemetryTimeout: 10000,
TwinUpdateTimeout: 10000,
CommandTimeout: 10000,
RegistrationAttemptTimeout: 30000,
MaxConcurrentConnections: 10,
MaxConcurrentTwinUpdates: 10,
MaxConcurrentRegistrations: 10,
MaxConcurrentDeletes: 10,
MaxRegistrationAttempts: 10,
EnableTelemetry: true,
EnableReportedProps: false,
EnableTwinUpdateAcks: false,
EnableCommandAcks: false,
},
}
}