MCPcopy Create free account
hub / github.com/apache/openwhisk-cli / getChildValues

Function getChildValues

commands/util.go:561–585  ·  view source on GitHub ↗
(keyValueArr whisk.KeyValueArr, key string, childKey string)

Source from the content-addressed store, hash-verified

559}
560
561func getChildValues(keyValueArr whisk.KeyValueArr, key string, childKey string) []interface{} {
562 var value interface{}
563 var res []interface{}
564
565 value = keyValueArr.GetValue(key)
566
567 castedValue, canCast := value.([]interface{})
568 if canCast {
569 for i := 0; i < len(castedValue); i++ {
570 castedValue, canCast := castedValue[i].(map[string]interface{})
571 if canCast {
572 for subKey, subValue := range castedValue {
573 if subKey == childKey {
574 res = append(res, subValue)
575 }
576 }
577 }
578 }
579 }
580
581 whisk.Debug(whisk.DbgInfo, "Got values '%s' from '%v' for key '%s' and child key '%s'\n", res, keyValueArr, key,
582 childKey)
583
584 return res
585}
586
587func getChildValueStrings(keyValueArr whisk.KeyValueArr, key string, childKey string) []string {
588 var keys []interface{}

Callers 1

getChildValueStringsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected