All Projects → theimpossibleastronaut → configster

theimpossibleastronaut / configster

Licence: MIT license
Rust library for parsing configuration files

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to configster

Dynaconf
Configuration Management for Python ⚙
Stars: ✭ 2,082 (+10857.89%)
Mutual labels:  config, settings, configuration-management
Simple Settings
A simple way to manage your project settings.
Stars: ✭ 165 (+768.42%)
Mutual labels:  config, settings, configuration-management
climatecontrol
Python library for loading settings and config data from files and environment variables
Stars: ✭ 20 (+5.26%)
Mutual labels:  config, settings, configuration-management
Electrode Confippet
node.js environment aware application configuration
Stars: ✭ 109 (+473.68%)
Mutual labels:  config, configuration-management
plaster
Application config settings abstraction layer.
Stars: ✭ 19 (+0%)
Mutual labels:  config, settings
Ins sandstorm
[INS] Config setting for our sandstorm server
Stars: ✭ 61 (+221.05%)
Mutual labels:  config, settings
Appconfiguration
Questions, feedback and samples for Azure App Configuration service
Stars: ✭ 116 (+510.53%)
Mutual labels:  config, configuration-management
Config
Library for managing environment variables in Clojure using EDN configuration files
Stars: ✭ 125 (+557.89%)
Mutual labels:  config, configuration-management
Node Convict
Featureful configuration management library for Node.js
Stars: ✭ 1,855 (+9663.16%)
Mutual labels:  config, configuration-management
Config
Easiest way to add multi-environment yaml settings to Rails, Sinatra, Pandrino and other Ruby projects.
Stars: ✭ 1,821 (+9484.21%)
Mutual labels:  config, configuration-management
ini
📝 Go INI config management. support multi file load, data override merge. parse ENV variable, parse variable reference. Dotenv file parse and loader. INI配置读取管理,支持多文件加载,数据覆盖合并, 解析ENV变量, 解析变量引用。DotEnv 解析加载
Stars: ✭ 72 (+278.95%)
Mutual labels:  config, configuration-management
Node No Config
Config and resource loader
Stars: ✭ 45 (+136.84%)
Mutual labels:  config, configuration-management
Configuration
Library for setting values to structs' fields from env, flags, files or default tag
Stars: ✭ 37 (+94.74%)
Mutual labels:  config, configuration-management
Rime pure
【rime小狼毫\trime同文】手机/PC一站式配置【简约皮肤\拼音搜狗词库\原创trime同文四叶草九宫格拼音方案\四叶草拼音、小鹤双拼、极品五笔、徐码、郑码】 rime配置
Stars: ✭ 73 (+284.21%)
Mutual labels:  config, settings
Config Rs
⚙️ Layered configuration system for Rust applications (with strong support for 12-factor applications).
Stars: ✭ 915 (+4715.79%)
Mutual labels:  config, configuration-management
Qonfig
Config. Defined as a class. Used as an instance. Lazy instantiation. Validation layer. Thread-safe. Support for YAML, TOML, JSON, __END__, ENV. Extremely simple to define. Extremely simple to use.
Stars: ✭ 17 (-10.53%)
Mutual labels:  config, settings
sitri
Sitri - powerful settings & configs for python
Stars: ✭ 20 (+5.26%)
Mutual labels:  config, configuration-management
Conf
Simple config handling for your app or module
Stars: ✭ 707 (+3621.05%)
Mutual labels:  config, configuration-management
Strictyaml
Type-safe YAML parser and validator.
Stars: ✭ 836 (+4300%)
Mutual labels:  config, configuration-management
Dotfiles
Config for vim sublime awesome xmonad etc.
Stars: ✭ 140 (+636.84%)
Mutual labels:  config, settings

Rust-badge crates-badge

configster

Rust library for parsing configuration files

Config file format

The 'option' can be any string with no whitespace.

arbitrary_option = false
max_users = 30

The value for an option following the equal sign may have "attributes" that are separated by a delimiter. The delimiter is specified when calling parse_file():

parse_file("./config_test.conf", ',')
option = Blue, light, shiny
# option = nothing, void, empty, commented_out

An option is not required to be followed by a value. It can be used to disable a default feature.

FeatureOff

API

Calling parse_file() will return a single vector containing a struct (OptionProperties) for each option line in the config file. The attributes for a value are stored in a vector within the "Value" struct.

#[derive(Debug, PartialEq)]
pub struct Value {
    pub primary: String,
    pub attributes: Vec<String>,
}

#[derive(Debug, PartialEq)]
pub struct OptionProperties {
    pub option: String,
    pub value: Value,
}

Example Code

use std::io;

fn main() -> Result<(), io::Error> {

    let config_vec = configster::parse_file("./config_test.conf", ',')?;

    for i in &config_vec {
        println!("Option:'{}' | value '{}'", i.option, i.value.primary);

        for j in &i.value.attributes {
            println!("attr:'{}`", j);
        }
        println!();
    }
    Ok(())
}

See docs.rs/configster/ for generated API documentation.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].