MCPcopy Index your code
hub / github.com/zalando/skipper / loadPredicatePlugin

Function loadPredicatePlugin

plugins.go:275–290  ·  view source on GitHub ↗
(path string, args []string)

Source from the content-addressed store, hash-verified

273}
274
275func loadPredicatePlugin(path string, args []string) (routing.PredicateSpec, error) {
276 mod, err := plugin.Open(path)
277 if err != nil {
278 return nil, fmt.Errorf("open predicate module %s: %s", path, err)
279 }
280
281 conf, err := readPluginConfig(path)
282 if err != nil {
283 return nil, fmt.Errorf("failed to read config for %s: %s", path, err)
284 }
285 sym, err := mod.Lookup("InitPredicate")
286 if err != nil {
287 return nil, fmt.Errorf("lookup module symbol failed for %s: %s", path, err)
288 }
289 return initPredicatePlugin(sym, path, append(conf, args...))
290}
291
292func initPredicatePlugin(sym plugin.Symbol, path string, args []string) (routing.PredicateSpec, error) {
293 fn, ok := sym.(func([]string) (routing.PredicateSpec, error))

Callers 1

loadPredicatePluginsMethod · 0.85

Calls 4

readPluginConfigFunction · 0.85
initPredicatePluginFunction · 0.85
ErrorfMethod · 0.65
LookupMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…