mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 18:35:51 +02:00
feat: add directive auto complete and documents #816
This commit is contained in:
parent
830ed28148
commit
5911462f90
25 changed files with 4288 additions and 306 deletions
22
internal/nginx/directives.go
Normal file
22
internal/nginx/directives.go
Normal file
|
@ -0,0 +1,22 @@
|
|||
package nginx
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
//go:embed nginx_directives.json
|
||||
var directivesJson []byte
|
||||
|
||||
type Directive struct {
|
||||
Links []string `json:"links"`
|
||||
}
|
||||
|
||||
func GetDirectives() (map[string]Directive, error) {
|
||||
var directives map[string]Directive
|
||||
err := json.Unmarshal(directivesJson, &directives)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return directives, nil
|
||||
}
|
3670
internal/nginx/nginx_directives.json
Normal file
3670
internal/nginx/nginx_directives.json
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue