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

Method RemoveDirective

agent/utils/nginx/components/http.go:104–121  ·  view source on GitHub ↗
(key string, params []string)

Source from the content-addressed store, hash-verified

102}
103
104func (h *Http) RemoveDirective(key string, params []string) {
105 directives := h.GetDirectives()
106 var newDirectives []IDirective
107 for _, dir := range directives {
108 if dir.GetName() == key {
109 if IsRepeatKey(key) && len(params) > 0 {
110 oldParams := dir.GetParameters()
111 if oldParams[0] == params[0] {
112 continue
113 }
114 } else {
115 continue
116 }
117 }
118 newDirectives = append(newDirectives, dir)
119 }
120 h.Directives = newDirectives
121}
122
123func (h *Http) GetBlock() IBlock {
124 return h

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