Add Rules lookup for config
1 files changed, 5 insertions(+), 0 deletions(-) M internal/config/v1/config.go
M internal/config/v1/config.go => internal/config/v1/config.go +5 -0
@@ 21,6 21,11 @@ type Config struct { Rules []Rule } +func (cfg *Config) RulesForAction(action string) ([]*Rule, bool) { + rules, ok := cfg.actionmap[action] + return rules, ok +} + func ReadConfigFile(path string) (*Config, error) { data, err := ioutil.ReadFile(path) if err != nil {