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

Method loadFilterPlugins

plugins.go:209–225  ·  view source on GitHub ↗
(found map[string]string, done map[string][]string)

Source from the content-addressed store, hash-verified

207}
208
209func (o *Options) loadFilterPlugins(found map[string]string, done map[string][]string) error {
210 for _, fltr := range o.FilterPlugins {
211 name := fltr[0]
212 path, ok := found[name]
213 if !ok {
214 return fmt.Errorf("filter plugin %s not found in plugin dirs", name)
215 }
216 spec, err := loadFilterPlugin(path, fltr[1:])
217 if err != nil {
218 return fmt.Errorf("failed to load plugin %s: %s", path, err)
219 }
220 o.CustomFilters = append(o.CustomFilters, spec)
221 log.Printf("loaded plugin %s (%s) from %s", name, spec.Name(), path)
222 markPluginLoaded(done, name, "InitFilter")
223 }
224 return nil
225}
226
227func loadFilterPlugin(path string, args []string) (filters.Spec, error) {
228 mod, err := plugin.Open(path)

Callers 1

findAndLoadPluginsMethod · 0.95

Calls 4

loadFilterPluginFunction · 0.85
markPluginLoadedFunction · 0.85
ErrorfMethod · 0.65
NameMethod · 0.65

Tested by

no test coverage detected