MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / FindDirectives

Method FindDirectives

agent/utils/nginx/components/http.go:60–72  ·  view source on GitHub ↗
(directiveName string)

Source from the content-addressed store, hash-verified

58}
59
60func (h *Http) FindDirectives(directiveName string) []IDirective {
61 directives := make([]IDirective, 0)
62 for _, directive := range h.GetDirectives() {
63 if directive.GetName() == directiveName {
64 directives = append(directives, directive)
65 }
66 if directive.GetBlock() != nil {
67 directives = append(directives, directive.GetBlock().FindDirectives(directiveName)...)
68 }
69 }
70
71 return directives
72}
73
74func (h *Http) UpdateDirective(key string, params []string) {
75 if key == "" || len(params) == 0 {

Callers

nothing calls this directly

Calls 4

GetDirectivesMethod · 0.95
GetNameMethod · 0.65
GetBlockMethod · 0.65
FindDirectivesMethod · 0.65

Tested by

no test coverage detected