mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-12 02:45:49 +02:00
18 lines
414 B
Go
18 lines
414 B
Go
package nginx
|
|
|
|
import (
|
|
"github.com/tufanbarisyildirim/gonginx"
|
|
"github.com/tufanbarisyildirim/gonginx/parser"
|
|
)
|
|
|
|
func (c *NgxConfig) FmtCode() (fmtContent string) {
|
|
fmtContent = gonginx.DumpConfig(c.c, gonginx.IndentedStyle)
|
|
return
|
|
}
|
|
|
|
func FmtCode(content string) (fmtContent string) {
|
|
p := parser.NewStringParser(content)
|
|
c := p.Parse()
|
|
fmtContent = gonginx.DumpConfig(c, gonginx.IndentedStyle)
|
|
return
|
|
}
|