fix plugin init
This commit is contained in:
parent
a5ce3e32da
commit
065c7d5616
@ -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",
|
||||
|
@ -62,8 +62,11 @@ 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 fmt.Errorf("Unknown plugin type: %s for %s", c.Type, c.Name)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Load loads a plugin created with `go build -buildmode=plugin`
|
||||
|
Loading…
x
Reference in New Issue
Block a user