fix plugin init

This commit is contained in:
Asim Aslam 2019-09-10 05:32:49 -07:00
parent a5ce3e32da
commit 065c7d5616
2 changed files with 4 additions and 6 deletions

View File

@ -92,11 +92,6 @@ var (
EnvVar: "MICRO_CLIENT_POOL_TTL",
Usage: "Sets the client connection pool ttl. e.g 500ms, 5s, 1m. Default: 1m",
},
cli.StringSliceFlag{
Name: "plugin",
EnvVar: "MICRO_PLUGIN",
Usage: "Comma separated list of plugins e.g /path/to/plugin.so",
},
cli.IntFlag{
Name: "register_ttl",
EnvVar: "MICRO_REGISTER_TTL",

View File

@ -62,10 +62,13 @@ func (p *plugin) Init(c *Config) error {
return fmt.Errorf("Invalid plugin %s", c.Name)
}
cmd.DefaultTransports[c.Name] = pg
}
default:
return fmt.Errorf("Unknown plugin type: %s for %s", c.Type, c.Name)
}
return nil
}
// Load loads a plugin created with `go build -buildmode=plugin`
func (p *plugin) Load(path string) (*Config, error) {
plugin, err := pg.Open(path)