From ac3d735b66ddf66cd3f30d283f92c12f8bdb57c2 Mon Sep 17 00:00:00 2001 From: Radu Ioan Fericean Date: Tue, 8 Dec 2015 15:53:59 +0200 Subject: [PATCH] build fix again --- utils/apitpdata.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/utils/apitpdata.go b/utils/apitpdata.go index e474b8bba..72e2d8c7f 100644 --- a/utils/apitpdata.go +++ b/utils/apitpdata.go @@ -792,6 +792,18 @@ type AttrDerivedChargers struct { Direction, Tenant, Category, Account, Subject, Destination string } +func NewTAFromAccountKey(accountKey string) (*TenantAccount, error) { + accountSplt := strings.Split(accountKey, CONCATENATED_KEY_SEP) + if len(accountSplt) != 2 { + return nil, fmt.Errorf("Unsupported format for TenantAccount: %s", accountKey) + } + return &TenantAccount{accountSplt[0], accountSplt[1]}, nil +} + +type TenantAccount struct { + Tenant, Account string +} + func NewDTCSFromRPKey(rpKey string) (*DirectionTenantCategorySubject, error) { rpSplt := strings.Split(rpKey, CONCATENATED_KEY_SEP) if len(rpSplt) != 4 {