mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Add method on ERsCfg to retrieve reader by ID
This commit is contained in:
committed by
Dan Christian Bogos
parent
b9b07dc561
commit
b924fc9e0c
@@ -35,6 +35,18 @@ type ERsCfg struct {
|
||||
PartialCacheTTL time.Duration
|
||||
}
|
||||
|
||||
// ReaderCfg iterates over the Readers slice and returns if it finds any
|
||||
// reader configuration where the ID is equal to the "ID" parameter. If
|
||||
// none were found, the method will return nil.
|
||||
func (erS *ERsCfg) ReaderCfg(ID string) *EventReaderCfg {
|
||||
for _, rdr := range erS.Readers {
|
||||
if rdr.ID == ID {
|
||||
return rdr
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (erS *ERsCfg) loadFromJSONCfg(jsnCfg *ERsJsonCfg, msgTemplates map[string][]*FCTemplate, sep string, dfltRdrCfg *EventReaderCfg, separator string) (err error) {
|
||||
if jsnCfg == nil {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user