(found map[string]string, done map[string][]string)
| 207 | } |
| 208 | |
| 209 | func (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 | |
| 227 | func loadFilterPlugin(path string, args []string) (filters.Spec, error) { |
| 228 | mod, err := plugin.Open(path) |
no test coverage detected