MCPcopy Create free account
hub / github.com/BishopFox/cloudfox / getCodeArtifactDomainsPerRegion

Method getCodeArtifactDomainsPerRegion

aws/inventory.go:2563–2604  ·  view source on GitHub ↗
(r string, wg *sync.WaitGroup, semaphore chan struct{})

Source from the content-addressed store, hash-verified

2561}
2562
2563func (m *Inventory2Module) getCodeArtifactDomainsPerRegion(r string, wg *sync.WaitGroup, semaphore chan struct{}) {
2564 defer func() {
2565 wg.Done()
2566 m.CommandCounter.DecrExecuting()
2567 m.CommandCounter.IncrComplete()
2568 }()
2569 semaphore <- struct{}{}
2570 defer func() {
2571 <-semaphore
2572 }()
2573 // m.CommandCounter.IncrTotal()
2574 m.CommandCounter.DecrPending()
2575 m.CommandCounter.IncrExecuting()
2576 var totalCountThisServiceThisRegion = 0
2577 var service = "CodeArtifact Domains"
2578 var resourceNames []string
2579
2580 Domains, err := sdk.CachedCodeArtifactListDomains(m.CodeArtifactClient, aws.ToString(m.Caller.Account), r)
2581 if err != nil {
2582 m.modLog.Error(err.Error())
2583 m.CommandCounter.IncrError()
2584 return
2585 }
2586
2587 // Add this page of resources to the total count
2588 totalCountThisServiceThisRegion = totalCountThisServiceThisRegion + len(Domains)
2589
2590 // Add this page of resources to the module's resource list
2591 for _, domain := range Domains {
2592 arn := aws.ToString(domain.Arn)
2593 resourceNames = append(resourceNames, arn)
2594 }
2595
2596 // No more pages, update the module's service map
2597 m.mu.Lock()
2598 m.resources = append(m.resources, resourceNames...)
2599 m.serviceMap[service][r] = totalCountThisServiceThisRegion
2600 m.totalRegionCounts[r] = m.totalRegionCounts[r] + totalCountThisServiceThisRegion
2601 m.serviceMap["total"][r] = m.serviceMap["total"][r] + totalCountThisServiceThisRegion
2602
2603 m.mu.Unlock()
2604}
2605
2606func (m *Inventory2Module) getCodeBuildProjectsPerRegion(r string, wg *sync.WaitGroup, semaphore chan struct{}) {
2607 defer func() {

Callers 1

executeChecksMethod · 0.95

Calls 7

DecrExecutingMethod · 0.80
IncrCompleteMethod · 0.80
DecrPendingMethod · 0.80
IncrExecutingMethod · 0.80
ErrorMethod · 0.80
IncrErrorMethod · 0.80

Tested by

no test coverage detected