From 8e1898e6c9140a5c7fcca22fd71178668d1b99a2 Mon Sep 17 00:00:00 2001 From: TeoV Date: Tue, 10 Mar 2020 11:16:07 +0200 Subject: [PATCH] Add GetRule function for RSRParsers --- config/rsrparser.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/config/rsrparser.go b/config/rsrparser.go index 5ea3294ea..275bf584f 100644 --- a/config/rsrparser.go +++ b/config/rsrparser.go @@ -63,6 +63,17 @@ func NewRSRParsersMustCompile(parsersRules string, allFiltersMatch bool, rsrSepa // RSRParsers is a set of RSRParser type RSRParsers []*RSRParser +func (prsrs RSRParsers) GetRule() (out string) { + for i, prsr := range prsrs { + if i == 0 { + out = prsr.Rules + } else { + out = out + utils.NestingSep + prsr.Rules + } + } + return +} + func (prsrs RSRParsers) Compile() (err error) { for _, prsr := range prsrs { if err = prsr.Compile(); err != nil {