Git Product home page Git Product logo

systemdparser's Introduction

SystemdParser: A Light-Weight Crate for Parsing Systemd Configuration Files

SystemdParser is a light-weight Rust crate that simplifies the management of systemd configuration files in a type-safe and DRY (don't repeat yourself) fashion. With SystemdParser, you can easily parse .service, .socket, .target, and .mount files, without having to worry about parsing strings or unwrapping any Options.

Features:

Type safe: the crate uses Rust's strong typing system to ensure that the code using the configuration values does not have to parse strings or unwrap Options. All values already have the correct type.

Layered configuration: SystemdParser allows you to load and merge multiple sources of configuration, including environment variables, TOML, YAML, JSON5, and anything with a serde Deserializer.

Easy-to-use macros: SystemdParser provides the #[derive(Config)] macro, which is similar to confique's implementation, making it easy to define the configuration struct. The crate will automatically recognize and parse the specific values based on their type, such as date, time, bool, and so on.

With SystemdParser, you can generate configuration templates that describe all available config values to your users without repeating yourself.

Installation:

You can install SystemdParser by adding the following line to your Cargo.toml file:

systemd_parser = "0.1.0"

Usage:

To use SystemdParser, simply add the #[derive(Config)] macro to your struct definition, like this:

#[derive(Config)]
struct MyConfig {
    // ...
}

Then, you can load and parse the configuration values from the corresponding systemd configuration file, like this:

let config = MyConfig::parse("/etc/systemd/system/my-service.service")?;

Contributing:

If you find any bugs or have any feature requests, please feel free to open an issue or submit a pull request on GitHub at https://github.com//systemd_parser.

License:

SystemdParser is released under the MIT License. See the LICENSE file for details.

systemdparser's People

Contributors

clo91eaf avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.