pub fn parse(input: &str) -> Result<Config>Expand description
Parse NGINX configuration from text
This is the main entry point for parsing.
§Errors
Returns an error if:
- The input contains syntax errors
- Unexpected tokens are encountered
- The configuration structure is invalid
§Examples
use nginx_discovery::parse;
let config = "user nginx;";
let result = parse(config).unwrap();
assert_eq!(result.directives.len(), 1);