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

Method RemoveDirective

agent/utils/nginx/components/upstream.go:114–131  ·  view source on GitHub ↗
(key string, params []string)

Source from the content-addressed store, hash-verified

112}
113
114func (us *Upstream) RemoveDirective(key string, params []string) {
115 directives := us.Directives
116 var newDirectives []IDirective
117 for _, dir := range directives {
118 if dir.GetName() == key {
119 if IsRepeatKey(key) && len(params) > 0 {
120 oldParams := dir.GetParameters()
121 if oldParams[0] == params[0] {
122 continue
123 }
124 } else {
125 continue
126 }
127 }
128 newDirectives = append(newDirectives, dir)
129 }
130 us.Directives = newDirectives
131}
132
133func (us *Upstream) GetLine() int {
134 return us.Line

Callers

nothing calls this directly

Calls 3

IsRepeatKeyFunction · 0.85
GetNameMethod · 0.65
GetParametersMethod · 0.65

Tested by

no test coverage detected