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

Method FindDirectives

agent/utils/nginx/components/upstream.go:70–82  ·  view source on GitHub ↗
(directiveName string)

Source from the content-addressed store, hash-verified

68}
69
70func (us *Upstream) FindDirectives(directiveName string) []IDirective {
71 directives := make([]IDirective, 0)
72 for _, directive := range us.Directives {
73 if directive.GetName() == directiveName {
74 directives = append(directives, directive)
75 }
76 if directive.GetBlock() != nil {
77 directives = append(directives, directive.GetBlock().FindDirectives(directiveName)...)
78 }
79 }
80
81 return directives
82}
83
84func (us *Upstream) UpdateDirective(key string, params []string) {
85 if key == "" {

Callers

nothing calls this directly

Calls 3

GetNameMethod · 0.65
GetBlockMethod · 0.65
FindDirectivesMethod · 0.65

Tested by

no test coverage detected