File tree Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,8 @@ use serde::Deserialize;
5
5
6
6
pub const VERSION : & str = env ! ( "CARGO_PKG_VERSION" ) ;
7
7
8
- #[ derive( Deserialize , Default ) ]
8
+ #[ derive( Deserialize ) ]
9
+ #[ serde( default ) ]
9
10
pub struct UdpForwarder {
10
11
pub log_level : String ,
11
12
#[ serde( default ) ]
@@ -14,7 +15,19 @@ pub struct UdpForwarder {
14
15
pub servers : Vec < Server > ,
15
16
}
16
17
18
+ impl Default for UdpForwarder {
19
+ fn default ( ) -> Self {
20
+ UdpForwarder {
21
+ log_level : "INFO" . to_string ( ) ,
22
+ log_to_syslog : false ,
23
+ metrics_bind : "" . to_string ( ) ,
24
+ servers : vec ! [ ] ,
25
+ }
26
+ }
27
+ }
28
+
17
29
#[ derive( Deserialize ) ]
30
+ #[ serde( default ) ]
18
31
pub struct Server {
19
32
pub server : String ,
20
33
pub keepalive_interval_secs : u64 ,
@@ -37,12 +50,22 @@ impl Default for Server {
37
50
}
38
51
}
39
52
40
- #[ derive( Deserialize , Default ) ]
53
+ #[ derive( Deserialize ) ]
54
+ #[ serde( default ) ]
41
55
pub struct Concentratord {
42
56
pub event_url : String ,
43
57
pub command_url : String ,
44
58
}
45
59
60
+ impl Default for Concentratord {
61
+ fn default ( ) -> Self {
62
+ Concentratord {
63
+ event_url : "ipc:///tmp/concentratord_event" . to_string ( ) ,
64
+ command_url : "ipc:///tmp/concentratord_command" . to_string ( ) ,
65
+ }
66
+ }
67
+ }
68
+
46
69
#[ derive( Deserialize ) ]
47
70
pub struct Configuration {
48
71
pub udp_forwarder : UdpForwarder ,
You can’t perform that action at this time.
0 commit comments