Crate all_env

source ·
Expand description

A library to retrieve environment variables from different file types.

Supported file types

  • Simple txt files (.txt, .env)
  • JSON files (.json)

Examples with debug

use all_env::EnvHolder;
 // With debug flag set to true
let env_holder = EnvHolder::new(true);
let url = env_holder.get_var("url");
if let Some(url_value) = url { 
    // Further processing  
 }

Examples without debug with and a custom file_name

use all_env::EnvHolder;
 // With debug flag set to true
let env_holder = EnvHolder::new(false).with_file_name("custom_file.env");
let url = env_holder.get_var("url");
if let Some(url_value) = url {   
    // Further processing
 }

Structs