Code Review
/
ric-plt
/
nodeb-rnib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
[RICPLT-2523] Add GetE2TInstances | GetE2TAddresses
[ric-plt/nodeb-rnib.git]
/
common
/
utils.go
diff --git
a/common/utils.go
b/common/utils.go
index
608130e
..
d849021
100644
(file)
--- a/
common/utils.go
+++ b/
common/utils.go
@@
-91,8
+91,20
@@
func ValidateAndBuildRanLoadInformationKey(inventoryName string) (string, error)
func ValidateAndBuildE2TInstanceKey(address string) (string, error) {
if address == "" {
func ValidateAndBuildE2TInstanceKey(address string) (string, error) {
if address == "" {
- return "", NewValidationError("#utils.ValidateAndBuild
RanLoadInformationKey - an empty inventory name
received")
+ return "", NewValidationError("#utils.ValidateAndBuild
E2TInstanceKey - an empty E2T address
received")
}
return fmt.Sprintf("E2TInstance:%s", address), nil
}
return fmt.Sprintf("E2TInstance:%s", address), nil
-}
\ No newline at end of file
+}
+
+func MapE2TAddressesToKeys(addresses []string) []string {
+
+ keys := []string{}
+ for _, v := range addresses {
+ if len(v) != 0 {
+ keys = append(keys, fmt.Sprintf("E2TInstance:%s", v))
+ }
+ }
+
+ return keys
+}