File tree Expand file tree Collapse file tree
implementations/rust/ockam Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,15 +11,11 @@ pub(crate) mod outlet;
1111pub ( crate ) mod producer;
1212pub ( crate ) mod util;
1313
14- const KAFKA_DEFAULT_BOOTSTRAP_ADDRESS : StaticHostnamePort =
15- StaticHostnamePort :: new ( "127.0.0.1" , 9092 ) ;
14+ const KAFKA_DEFAULT_BOOTSTRAP_ADDRESS : StaticHostnamePort = StaticHostnamePort :: localhost ( 9092 ) ;
1615const KAFKA_DEFAULT_PROJECT_ROUTE : & str = "/project/default" ;
17- const KAFKA_DEFAULT_CONSUMER_SERVER : StaticHostnamePort =
18- StaticHostnamePort :: new ( "127.0.0.1" , 4000 ) ;
19- const KAFKA_DEFAULT_INLET_BIND_ADDRESS : StaticHostnamePort =
20- StaticHostnamePort :: new ( "127.0.0.1" , 4000 ) ;
21- const KAFKA_DEFAULT_PRODUCER_SERVER : StaticHostnamePort =
22- StaticHostnamePort :: new ( "127.0.0.1" , 5000 ) ;
16+ const KAFKA_DEFAULT_CONSUMER_SERVER : StaticHostnamePort = StaticHostnamePort :: localhost ( 4000 ) ;
17+ const KAFKA_DEFAULT_INLET_BIND_ADDRESS : StaticHostnamePort = StaticHostnamePort :: localhost ( 4000 ) ;
18+ const KAFKA_DEFAULT_PRODUCER_SERVER : StaticHostnamePort = StaticHostnamePort :: localhost ( 5000 ) ;
2319
2420fn kafka_default_outlet_addr ( ) -> String {
2521 DefaultAddress :: KAFKA_OUTLET . to_string ( )
Original file line number Diff line number Diff line change @@ -21,6 +21,13 @@ impl StaticHostnamePort {
2121 pub const fn new ( hostname : & ' static str , port : u16 ) -> Self {
2222 Self { hostname, port }
2323 }
24+
25+ pub const fn localhost ( port : u16 ) -> Self {
26+ Self {
27+ hostname : "127.0.0.1" ,
28+ port,
29+ }
30+ }
2431}
2532
2633impl TryFrom < StaticHostnamePort > for HostnamePort {
You can’t perform that action at this time.
0 commit comments