(path string, args []string)
| 273 | } |
| 274 | |
| 275 | func 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 | |
| 292 | func initPredicatePlugin(sym plugin.Symbol, path string, args []string) (routing.PredicateSpec, error) { |
| 293 | fn, ok := sym.(func([]string) (routing.PredicateSpec, error)) |
no test coverage detected
searching dependent graphs…