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

Method UpdateDirectiveBySecondKey

agent/utils/nginx/components/server.go:482–497  ·  view source on GitHub ↗
(name string, key string, directive Directive)

Source from the content-addressed store, hash-verified

480}
481
482func (s *Server) UpdateDirectiveBySecondKey(name string, key string, directive Directive) {
483 directives := s.Directives
484 index := -1
485 for i, dir := range directives {
486 if dir.GetName() == name && dir.GetParameters()[0] == key {
487 index = i
488 break
489 }
490 }
491 if index > -1 {
492 directives[index] = &directive
493 } else {
494 directives = append(directives, &directive)
495 }
496 s.Directives = directives
497}
498
499func (s *Server) RemoveListenByBind(bind string) {
500 var listens []*ServerListen

Callers 4

UpdateRootProxyForAiMethod · 0.95
UpdateRootProxyMethod · 0.95
UpdatePHPProxyMethod · 0.95
AddHTTP2HTTPSMethod · 0.95

Calls 2

GetNameMethod · 0.65
GetParametersMethod · 0.65

Tested by

no test coverage detected