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

Method RemoveDirective

agent/utils/nginx/components/block.go:75–92  ·  view source on GitHub ↗
(key string, params []string)

Source from the content-addressed store, hash-verified

73}
74
75func (b *Block) RemoveDirective(key string, params []string) {
76 directives := b.GetDirectives()
77 var newDirectives []IDirective
78 for _, dir := range directives {
79 if dir.GetName() == key {
80 if IsRepeatKey(key) && len(params) > 0 {
81 oldParams := dir.GetParameters()
82 if oldParams[0] == params[0] {
83 continue
84 }
85 } else {
86 continue
87 }
88 }
89 newDirectives = append(newDirectives, dir)
90 }
91 b.Directives = newDirectives
92}

Callers

nothing calls this directly

Calls 4

GetDirectivesMethod · 0.95
IsRepeatKeyFunction · 0.85
GetNameMethod · 0.65
GetParametersMethod · 0.65

Tested by

no test coverage detected