aluttik / go-crossplane

An unofficial Go port of the NGINX config/JSON converter crossplane
Apache License 2.0
50 stars 15 forks source link

direct analysis server.conf #6

Closed originnets closed 3 years ago

originnets commented 4 years ago

server { listen 127.0.0.1:8080; server_name www.test.com test.com; index index.html index.htm; }

How to parse the file directly

aluttik commented 4 years ago
payload, err := crossplane.Parse("path/to/server.conf", &crossplane.ParseOptions{})

This should give you a Payload struct that has the parsed content.

Does this answer your question?