You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Path to staging directory, ensures that it exists or panics
390
+
pubfnstaging_dir(&self) -> &PathBuf{
391
+
fs::create_dir_all(&self.local_staging_path)
392
+
.expect("Should be able to create dir if doesn't exist");
393
+
394
+
&self.local_staging_path
395
+
}
396
+
397
+
/// TODO: refactor and document
398
+
pubfnget_url(&self) -> Url{
399
+
ifself.ingestor_endpoint.is_empty(){
400
+
returnformat!(
401
+
"{}://{}",
402
+
self.get_scheme(),
403
+
self.address
404
+
)
405
+
.parse::<Url>()// if the value was improperly set, this will panic before hand
406
+
.unwrap_or_else(|err| {
407
+
panic!("{err}, failed to parse `{}` as Url. Please set the environment variable `P_ADDR` to `<ip address>:<port>` without the scheme (e.g., 192.168.1.1:8000). Please refer to the documentation: https://logg.ing/env for more details.",self.address)
408
+
});
409
+
}
410
+
411
+
let ingestor_endpoint = &self.ingestor_endpoint;
412
+
413
+
if ingestor_endpoint.starts_with("http"){
414
+
panic!("Invalid value `{}`, please set the environement variable `P_INGESTOR_ENDPOINT` to `<ip address / DNS>:<port>` without the scheme (e.g., 192.168.1.1:8000 or example.com:8000). Please refer to the documentation: https://logg.ing/env for more details.", ingestor_endpoint);
415
+
}
416
+
417
+
let addr_from_env = ingestor_endpoint.split(':').collect::<Vec<&str>>();
418
+
419
+
if addr_from_env.len() != 2{
420
+
panic!("Invalid value `{}`, please set the environement variable `P_INGESTOR_ENDPOINT` to `<ip address / DNS>:<port>` without the scheme (e.g., 192.168.1.1:8000 or example.com:8000). Please refer to the documentation: https://logg.ing/env for more details.", ingestor_endpoint);
421
+
}
422
+
423
+
letmut hostname = addr_from_env[0].to_string();
424
+
letmut port = addr_from_env[1].to_string();
425
+
426
+
// if the env var value fits the pattern $VAR_NAME:$VAR_NAME
panic!("The environement variable `{}` is not set, please set as <ip address / DNS> without the scheme (e.g., 192.168.1.1 or example.com). Please refer to the documentation: https://logg.ing/env for more details.", var_hostname);
434
+
}
435
+
if hostname.starts_with("http"){
436
+
panic!("Invalid value `{}`, please set the environement variable `{}` to `<ip address / DNS>` without the scheme (e.g., 192.168.1.1 or example.com). Please refer to the documentation: https://logg.ing/env for more details.", hostname, var_hostname);
0 commit comments