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

Method FindDirectives

agent/utils/nginx/components/location.go:162–173  ·  view source on GitHub ↗
(directiveName string)

Source from the content-addressed store, hash-verified

160}
161
162func (l *Location) FindDirectives(directiveName string) []IDirective {
163 directives := make([]IDirective, 0)
164 for _, directive := range l.Directives {
165 if directive.GetName() == directiveName {
166 directives = append(directives, directive)
167 }
168 if directive.GetBlock() != nil {
169 directives = append(directives, directive.GetBlock().FindDirectives(directiveName)...)
170 }
171 }
172 return directives
173}
174
175func (l *Location) UpdateDirective(key string, params []string) {
176 if key == "" || len(params) == 0 {

Callers

nothing calls this directly

Calls 3

GetNameMethod · 0.65
GetBlockMethod · 0.65
FindDirectivesMethod · 0.65

Tested by

no test coverage detected