@@ -20,12 +20,14 @@ type Config struct {
20
20
21
21
// Grid general settings
22
22
type Grid struct {
23
- ClientType string `json:"client_type"`
24
- Port int `json:"port"`
25
- StrategyList []Strategy `json:"strategy_list"`
26
- BusyNodeDuration string `json:"busy_node_duration"` // duration string format ex. 12m, see time.ParseDuration()
23
+ ClientType string `json:"client_type"`
24
+ Port int `json:"port"`
25
+ StrategyList []Strategy `json:"strategy_list"`
26
+ // duration string format ex. 12m, see time.ParseDuration()
27
+ BusyNodeDuration string `json:"busy_node_duration"`
27
28
// todo: выпилить и сделать равным дедлайну http запроса
28
- ReservedDuration string `json:"reserved_node_duration"` // duration string format ex. 12m, see time.ParseDuration()
29
+ ReservedDuration string `json:"reserved_node_duration"`
30
+ FixNodeTimeout string `json:"fix_node_timeout,omitempty"`
29
31
}
30
32
31
33
// Strategy - Describes the algorithm of node selection.
@@ -63,9 +65,19 @@ type Statsd struct {
63
65
CapabilitiesList []metrics.CapabilitiesSelector `json:"selectors"`
64
66
}
65
67
66
- // New - Constructor of config.
68
+ // New - Constructor of config with default values
67
69
func New () * Config {
68
- return & Config {}
70
+ return & Config {Logger : Logger {Level : "debug" },
71
+ DB : DB {Implementation : "local" },
72
+ Grid : Grid {
73
+ ClientType : "selenium" ,
74
+ Port : 4444 ,
75
+ StrategyList : []Strategy {{Type : "persistent" }},
76
+ ReservedDuration : "5m" ,
77
+ BusyNodeDuration : "15m" ,
78
+ FixNodeTimeout : "5m" ,
79
+ },
80
+ }
69
81
}
70
82
71
83
// LoadFromFile - config loader from json file.
0 commit comments