MCPcopy
hub / github.com/netdata/netdata / matchPrefix

Function matchPrefix

src/go/plugin/framework/functions/manager.go:718–730  ·  view source on GitHub ↗
(prefixes map[string]func(Function), id string)

Source from the content-addressed store, hash-verified

716}
717
718func matchPrefix(prefixes map[string]func(Function), id string) (string, func(Function), bool) {
719 if len(prefixes) == 0 || id == "" {
720 return "", nil, false
721 }
722
723 for prefix, handler := range prefixes {
724 if strings.HasPrefix(id, prefix) {
725 return prefix, handler, true
726 }
727 }
728
729 return "", nil, false
730}
731
732func (m *Manager) lookupFunctionRoute(fn Function) (handler func(Function), scheduleKey string, ok bool) {
733 snap, ok := m.snapshotFunction(fn.Name)

Callers 2

lookupFunctionRouteMethod · 0.85
lookupFunctionMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…