mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-12 19:05:55 +02:00
refactor: project structure
This commit is contained in:
parent
eab95dd091
commit
ee1f67b3cd
155 changed files with 269 additions and 261 deletions
18
server/internal/nginx/format_code.go
Normal file
18
server/internal/nginx/format_code.go
Normal file
|
@ -0,0 +1,18 @@
|
|||
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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue