Skip to content

loader for ".ecnf" file such as ".env". ".ecnf" is key-value setting file with key's hierarchy.

Notifications You must be signed in to change notification settings

ogata-k/dotecnf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dotecnf

What is .ecnf

".ecnf" is "Environment CoNFig" file such as ".env" file. .env is simple key-value store. So .enc cannot treat "key = {key = value}" and "key="(value is null). It is not useful. .ecnf is my original formatting file. .ecnf can treat them which .env cannot treat. .ecnf has following format.

# comment
# null (None)
ONLY_UPPER_START :

# empty string
EMPTY: ""

# not empty string
NOT_EMPTY :"value"

# fail
# sTart: 
# _START :""

ZERO : {
    FIRST : ""
    SECOND: {
        THIRD: "日本語"
    }
    FOURTH :
}

SUCCESS: {
}

# ERROR: {}

usage

// init
let mut loader = ECnfLoader::new();

// load: self.from<R: Read>(R), self.load_from_file(&Path), self.load_from_str(&str))
loader.load_from_str(input);

let ecnf: HashMap<String, Option<String>> = loader.build_ecnf();
// use ecnf...

About

loader for ".ecnf" file such as ".env". ".ecnf" is key-value setting file with key's hierarchy.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages