MCPcopy
hub / github.com/zalando/skipper / loadPlugin

Function loadPlugin

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

Source from the content-addressed store, hash-verified

177}
178
179func loadPlugin(path string, args []string) ([]filters.Spec, []routing.PredicateSpec, []routing.DataClient, error) {
180 mod, err := plugin.Open(path)
181 if err != nil {
182 return nil, nil, nil, fmt.Errorf("open multitype plugin %s: %s", path, err)
183 }
184
185 conf, err := readPluginConfig(path)
186 if err != nil {
187 return nil, nil, nil, fmt.Errorf("failed to read config for %s: %s", path, err)
188 }
189
190 sym, err := mod.Lookup("InitPlugin")
191 if err != nil {
192 return nil, nil, nil, fmt.Errorf("lookup module symbol failed for %s: %s", path, err)
193 }
194 return initPlugin(sym, path, append(conf, args...))
195}
196
197func initPlugin(sym plugin.Symbol, path string, args []string) ([]filters.Spec, []routing.PredicateSpec, []routing.DataClient, error) {
198 fn, ok := sym.(func([]string) ([]filters.Spec, []routing.PredicateSpec, []routing.DataClient, error))

Callers 1

loadPluginsMethod · 0.85

Calls 4

readPluginConfigFunction · 0.85
initPluginFunction · 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…