Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dottorblaster/corosync-config-parser
A Rust crate for hassle-free Corosync's configuration file parsing
https://github.com/dottorblaster/corosync-config-parser
Last synced: about 1 month ago
JSON representation
A Rust crate for hassle-free Corosync's configuration file parsing
- Host: GitHub
- URL: https://github.com/dottorblaster/corosync-config-parser
- Owner: dottorblaster
- License: mit
- Created: 2022-06-10T15:16:22.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-06-14T13:14:59.000Z (over 2 years ago)
- Last Synced: 2024-10-18T06:07:20.947Z (2 months ago)
- Language: Rust
- Size: 13.7 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# corosync-config-parser
A Rust crate for hassle-free Corosync's configuration file parsing.Inspired by [Kilobyte22/config-parser](https://github.com/Kilobyte22/config-parser).
## Usage
```rust
extern crate corosync_config_parser;let corosync_example = "
logging {
fileline: off
to_stderr: no
to_logfile: no
logfile: /var/log/cluster/corosync.log
to_syslog: yes
debug: off
timestamp: on
logger_subsys {
subsys: QUORUM
debug: off
}
}
"
.to_string();let cfg = corosync_config_parser::parse(corosync_example).unwrap();
let subsys = cfg
.matching("logging")
.nth(0)
.unwrap()
.matching("logger_subsys")
.nth(0)
.unwrap()
.matching("subsys")
.nth(0)
.unwrap()
.get(0);
```