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;
55
66pub const VERSION : & str = env ! ( "CARGO_PKG_VERSION" ) ;
77
8- #[ derive( Deserialize , Default ) ]
8+ #[ derive( Deserialize ) ]
9+ #[ serde( default ) ]
910pub struct UdpForwarder {
1011 pub log_level : String ,
1112 #[ serde( default ) ]
@@ -14,7 +15,19 @@ pub struct UdpForwarder {
1415 pub servers : Vec < Server > ,
1516}
1617
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+
1729#[ derive( Deserialize ) ]
30+ #[ serde( default ) ]
1831pub struct Server {
1932 pub server : String ,
2033 pub keepalive_interval_secs : u64 ,
@@ -37,12 +50,22 @@ impl Default for Server {
3750 }
3851}
3952
40- #[ derive( Deserialize , Default ) ]
53+ #[ derive( Deserialize ) ]
54+ #[ serde( default ) ]
4155pub struct Concentratord {
4256 pub event_url : String ,
4357 pub command_url : String ,
4458}
4559
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+
4669#[ derive( Deserialize ) ]
4770pub struct Configuration {
4871 pub udp_forwarder : UdpForwarder ,
You can’t perform that action at this time.
0 commit comments