mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-20 06:38:45 +05:00
added tests for opts with dynamic values
This commit is contained in:
committed by
Dan Christian Bogos
parent
c602dbc2a5
commit
06ccafb5fd
@@ -233,7 +233,7 @@ func GetDecimalBigOpts(ctx *context.Context, tnt string, ev *utils.CGREvent, fS
|
||||
// GetInterfaceOpts checks the specified option names in order among the keys in APIOpts returning the first value it finds as any, otherwise it
|
||||
// returns the config option if at least one filter passes or the default value if none of them do
|
||||
func GetInterfaceOpts(ctx *context.Context, tnt string, ev *utils.CGREvent, fS *FilterS, dynOpts []*config.DynamicInterfaceOpt,
|
||||
dftOpt any, optNames ...string) (cfgOpt any, err error) {
|
||||
optNames ...string) (cfgOpt any, err error) {
|
||||
for _, optName := range optNames {
|
||||
if opt, has := ev.APIOpts[optName]; has {
|
||||
return opt, nil
|
||||
@@ -250,7 +250,7 @@ func GetInterfaceOpts(ctx *context.Context, tnt string, ev *utils.CGREvent, fS *
|
||||
return opt.Value, nil
|
||||
}
|
||||
}
|
||||
return dftOpt, nil // return the default value if there are no options and none of the filters pass
|
||||
return
|
||||
}
|
||||
|
||||
// GetIntPointerOpts checks the specified option names in order among the keys in APIOpts returning the first value it finds as *int, otherwise it
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user