1
0

directives.go 379 B

12345678910111213141516171819202122
  1. package nginx
  2. import (
  3. _ "embed"
  4. "encoding/json"
  5. )
  6. //go:embed nginx_directives.json
  7. var directivesJson []byte
  8. type Directive struct {
  9. Links []string `json:"links"`
  10. }
  11. func GetDirectives() (map[string]Directive, error) {
  12. var directives map[string]Directive
  13. err := json.Unmarshal(directivesJson, &directives)
  14. if err != nil {
  15. return nil, err
  16. }
  17. return directives, nil
  18. }