feat: support export config outline and config marshal (#27)

This commit is contained in:
mzz
2023-02-25 22:53:18 +08:00
committed by GitHub
parent 90dac980b9
commit 5cf6dca509
21 changed files with 689 additions and 153 deletions

View File

@ -42,7 +42,7 @@ func (b *RulesBuilder) RegisterFunctionParser(funcName string, parser FunctionPa
func (b *RulesBuilder) Apply(rules []*config_parser.RoutingRule) (err error) {
for _, rule := range rules {
b.log.Debugln("[rule]", rule.String(true))
b.log.Debugln("[rule]", rule.String(true, false, false))
outbound, err := ParseOutbound(&rule.Outbound)
if err != nil {
return err
@ -80,7 +80,7 @@ func (b *RulesBuilder) Apply(rules []*config_parser.RoutingRule) (err error) {
}
if err = functionParser(b.log, f, key, paramValueGroup, overrideOutbound); err != nil {
return fmt.Errorf("failed to parse '%v': %w", f.String(false), err)
return fmt.Errorf("failed to parse '%v': %w", f.String(false, false, false), err)
}
}
}