Update template for DNSAgent and add new method V2ProcessEvent in SessionS

This commit is contained in:
TeoV
2019-07-14 18:00:59 +03:00
committed by Dan Christian Bogos
parent ae5f2e1d6b
commit 4e2164b741
8 changed files with 338 additions and 7 deletions

View File

@@ -19,6 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
package utils
import (
"reflect"
"strconv"
"strings"
)
@@ -275,3 +276,15 @@ func (fWp FlagsWithParams) ParamsSlice(subs string) (ps []string) {
}
return ps
}
//func to convert from FlagsWithParams back to []string
func (fWp FlagsWithParams) SliceFlags() (sls []string) {
for key, _ := range fWp {
if prmSlice := fWp.ParamsSlice(key); !reflect.DeepEqual(prmSlice, []string{}) {
sls = append(sls, ConcatenatedKey(key, strings.Join(prmSlice, INFIELD_SEP)))
} else {
sls = append(sls, key)
}
}
return
}