Require plugin declaration in config to use any plugin

This also makes it so `-test` without a config file tests all available
plugins with the default configuration. This mode is very useful for
getting some initial data out of tivan.
This commit is contained in:
Evan Phoenix
2015-05-18 14:10:12 -07:00
parent f1e1204374
commit b2c5d95737
3 changed files with 54 additions and 10 deletions

View File

@@ -50,6 +50,18 @@ func (c *Config) Apply(name string, v interface{}) error {
return nil
}
func (c *Config) PluginsDeclared() []string {
var plugins []string
for name, _ := range c.plugins {
plugins = append(plugins, name)
}
sort.Strings(plugins)
return plugins
}
func DefaultConfig() *Config {
return &Config{}
}