mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 02:15:48 +02:00
22 lines
379 B
Go
22 lines
379 B
Go
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
|
|
}
|