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:
12
config.go
12
config.go
@@ -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{}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user